:root {
  color-scheme: light;
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-alt: #eeeeec;
  --surface-subtle: #fafafa;
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(250, 250, 250, 0.94);
  --field-bg: #ffffff;
  --line: #deddda;
  --line-strong: #c2c0bb;
  --text: #242423;
  --muted: #6d6a66;
  --accent: #b32635;
  --accent-strong: #8f1d2b;
  --accent-soft: #f8e3e6;
  --brand-red: #c61f3a;
  --brand-red-soft: #f8e3e6;
  --graphite: #1d1d1d;
  --info: #356c8c;
  --info-soft: #e5f1f6;
  --warn: #a16207;
  --warn-soft: #fff4d8;
  --danger: #b42318;
  --danger-soft: #fae7e5;
  --success: #3f6f35;
  --success-soft: #e1efdd;
  --neutral: #6b7280;
  --neutral-soft: #eef3f6;
  --ink: #191918;
  --table-head: #ecebea;
  --table-row-hover: #f7f7f6;
  --button-secondary-bg: #ffffff;
  --app-grid-line: rgba(52, 48, 45, 0.085);
  --shadow: 0 12px 28px rgba(31, 44, 32, 0.09);
  --shadow-soft: 0 8px 18px rgba(31, 44, 32, 0.06);
  --radius: 8px;
  --motion-fast: 0.14s;
  --motion-base: 0.22s;
  --motion-slow: 0.34s;
  --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171717;
  --surface: #202020;
  --surface-alt: #292929;
  --surface-subtle: #191919;
  --sidebar-bg: #191919;
  --topbar-bg: rgba(22, 22, 22, 0.94);
  --field-bg: #151515;
  --line: #343434;
  --line-strong: #525252;
  --text: #f1f1ef;
  --muted: #b7b3ad;
  --accent: #c42a3f;
  --accent-strong: #f15a6c;
  --accent-soft: #3a161b;
  --brand-red: #f04458;
  --brand-red-soft: #3d161d;
  --graphite: #101010;
  --info: #93c5fd;
  --info-soft: #18283b;
  --warn: #f4c152;
  --warn-soft: #392a0c;
  --danger: #f87171;
  --danger-soft: #40191d;
  --success: #8fcf77;
  --success-soft: #1c3018;
  --neutral: #c4ccd0;
  --neutral-soft: #242a25;
  --ink: #f4f7ef;
  --table-head: #292929;
  --table-row-hover: #303030;
  --button-secondary-bg: #242424;
  --app-grid-line: rgba(255, 255, 255, 0.045);
  --shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 10px 22px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  line-height: 1.4;
  transition: background 0.18s ease, color 0.18s ease;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none !important;
  box-shadow: none !important;
}

* {
  scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--line-strong);
  background-clip: padding-box;
}

.hidden {
  display: none !important;
}

@keyframes sfiFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sfiSoftRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sfiScaleIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sfiSlideInRight {
  from {
    opacity: 0;
    transform: translateX(34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.login-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(22px, 4vw, 52px);
  overflow: hidden;
  background:
    radial-gradient(circle at 24% 14%, color-mix(in srgb, var(--brand-red) 18%, transparent), transparent 30%),
    radial-gradient(circle at 86% 82%, color-mix(in srgb, var(--brand-red) 16%, transparent), transparent 34%),
    linear-gradient(145deg, color-mix(in srgb, var(--graphite) 92%, var(--bg)), color-mix(in srgb, var(--bg) 88%, #000000));
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--line) 44%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--line) 44%, transparent) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.34;
  mask-image: linear-gradient(135deg, black 0%, black 62%, transparent 100%);
  pointer-events: none;
}

.login-layout {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 440px);
  gap: clamp(22px, 4vw, 52px);
  align-items: center;
}

.login-layout::before {
  content: "";
  position: absolute;
  inset: -42px;
  z-index: -1;
  border: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
  border-radius: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 16%, transparent), transparent 66%);
  opacity: 0.36;
  pointer-events: none;
}

.login-hero {
  display: grid;
  gap: 30px;
  color: var(--ink);
}

.login-brand-panel,
.login-quote-card {
  width: fit-content;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.login-brand-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
}

.login-logo {
  width: 154px;
  max-width: 38vw;
  height: 48px;
  object-fit: contain;
  border-radius: 11px;
  background: #101312;
  padding: 4px 8px;
}

.login-brand-panel strong,
.login-box-header h2,
.login-quote-card strong {
  display: block;
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.login-brand-panel span,
.login-box-header span,
.login-quote-card span,
.login-hero-copy p {
  color: var(--muted);
}

.login-hero-copy {
  max-width: 650px;
}

.login-hero-copy h1 {
  max-width: 620px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(36px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: 0;
}

.login-hero-copy p:not(.eyebrow) {
  max-width: 560px;
  margin: 20px 0 0;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.65;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  max-width: 520px;
}

.login-feature-grid span {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 10px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 66%, transparent);
  box-shadow: var(--shadow-soft);
}

.login-feature-grid span::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.login-quote-card {
  display: grid;
  gap: 6px;
  max-width: 560px;
  padding: 18px 20px;
  border-radius: 14px;
}

.login-box {
  width: min(480px, 100%);
  display: grid;
  gap: 20px;
  padding: clamp(30px, 4vw, 44px);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 22px;
  box-shadow: 0 30px 90px color-mix(in srgb, #000000 24%, transparent);
  backdrop-filter: blur(18px);
}

.login-box-header {
  display: grid;
  gap: 14px;
  padding-bottom: 6px;
  text-align: center;
}

.login-form-logo {
  justify-self: center;
  width: 206px;
  max-width: 70%;
  height: 64px;
  object-fit: contain;
  border-radius: 16px;
  background: #101010;
  padding: 7px 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.login-box-header h2 {
  font-size: 29px;
  line-height: 1.08;
}

.login-box .eyebrow {
  margin-bottom: 2px;
}

.login-box label {
  color: var(--text);
}

.login-box input {
  min-height: 54px;
  border-radius: 12px;
  padding-inline: 15px;
  background: color-mix(in srgb, var(--field-bg) 92%, var(--surface-alt));
}

.login-submit {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  font-size: 15px;
}

.login-link-button {
  width: fit-content;
  margin: -2px auto 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.login-link-button:hover {
  text-decoration: underline;
}

.login-helper {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

html[data-theme="light"] .login-screen {
  background:
    radial-gradient(circle at 20% 12%, color-mix(in srgb, var(--brand-red) 18%, transparent), transparent 28%),
    radial-gradient(circle at 86% 84%, color-mix(in srgb, var(--brand-red) 13%, transparent), transparent 34%),
    linear-gradient(145deg, #f7f6f4 0%, #ece9e5 48%, #f9f8f6 100%);
}

html[data-theme="light"] .login-screen::before {
  background:
    linear-gradient(90deg, rgba(52, 48, 45, 0.13) 1px, transparent 1px),
    linear-gradient(rgba(52, 48, 45, 0.13) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.58;
}

html[data-theme="light"] .login-layout::before {
  border-color: rgba(55, 50, 46, 0.18);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1) 62%);
  opacity: 1;
}

html[data-theme="light"] .login-hero-copy h1 {
  color: #181513;
}

html[data-theme="light"] .login-hero-copy .eyebrow,
html[data-theme="light"] .login-box .eyebrow {
  color: var(--brand-red);
}

html[data-theme="light"] .login-hero-copy p:not(.eyebrow),
html[data-theme="light"] .login-brand-panel span,
html[data-theme="light"] .login-quote-card span {
  color: #514b45;
}

html[data-theme="light"] .login-brand-panel,
html[data-theme="light"] .login-feature-grid span,
html[data-theme="light"] .login-quote-card {
  color: #201d1a;
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(82, 74, 68, 0.2);
}

html[data-theme="light"] .login-box {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(82, 74, 68, 0.18);
}

@media (max-width: 980px) {
  .login-screen {
    align-items: start;
    overflow: auto;
  }

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

  .login-layout::before {
    inset: -20px;
  }

  .login-hero {
    order: 2;
    gap: 18px;
  }

  .login-hero-copy h1 {
    max-width: 720px;
    font-size: clamp(34px, 8vw, 48px);
  }

  .login-box {
    order: 1;
    width: min(540px, 100%);
    justify-self: center;
  }
}

@media (max-width: 640px) {
  .login-screen {
    padding: 16px;
  }

  .login-layout::before,
  .login-quote-card {
    display: none;
  }

  .login-brand-panel {
    width: 100%;
  }

  .login-logo {
    width: 128px;
  }

  .login-hero-copy h1 {
    font-size: 34px;
  }

  .login-hero-copy p:not(.eyebrow) {
    font-size: 15px;
    line-height: 1.55;
  }

  .login-feature-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .login-feature-grid span {
    min-height: 38px;
  }

  .login-box {
    border-radius: 14px;
  }
}

.login-box h1,
.login-box h2,
.topbar h2,
.section-title h3 {
  margin: 0;
  letter-spacing: 0;
}

.login-box h1,
.login-box h2,
.topbar h2 {
  color: var(--ink);
}

.topbar h2 {
  font-size: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field-block {
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

.field-with-action label {
  min-width: 0;
}

.mini-button {
  min-height: 34px;
  justify-self: start;
  padding: 7px 10px;
  font-size: 12px;
}

.compact-panel,
.nested-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 12px;
}

.compact-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.main-category-manager {
  margin-top: 12px;
  align-items: flex-start;
}

.main-category-manager > div:first-child {
  min-width: 220px;
  display: grid;
  gap: 4px;
}

.main-category-list {
  flex: 1 1 420px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.main-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 6px 5px 12px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.main-category-chip small {
  color: var(--muted);
  font-size: 11px;
}

.main-category-chip button {
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
}

.catalog-main-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.catalog-list-tools {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto 1fr;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.catalog-search-field {
  display: grid;
  gap: 6px;
}

.catalog-search-field span,
.catalog-result-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.catalog-clear-slot {
  min-width: 36px;
  min-height: 36px;
  display: grid;
  place-items: end start;
}

.catalog-result-count {
  align-self: center;
  justify-self: end;
}

.catalog-pagination {
  margin-top: 12px;
}

.drag-handle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: grab;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -5px;
  user-select: none;
  touch-action: none;
  -webkit-user-drag: none;
}

.drag-handle:hover {
  color: var(--text);
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-alt) 70%, transparent);
}

.drag-handle:active,
[data-drag-scope].is-drag-scope-active .drag-handle {
  cursor: grabbing;
}

[data-drag-scope] {
  position: relative;
  isolation: isolate;
  transition: border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

[data-drag-scope].is-drag-scope-active {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

[data-drag-scope] .is-dragging {
  position: relative;
  z-index: 4;
  opacity: 0.9;
  will-change: transform;
}

[data-catalog-order-row].is-dragging > td {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent);
}

.selected-column-item.is-dragging {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent);
}

body.system-pointer-dragging {
  cursor: grabbing;
  user-select: none;
}

[data-catalog-order-row].is-drop-target > td {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow: inset 0 2px 0 var(--accent);
}

.selected-column-item.is-drop-target {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow: inset 0 2px 0 var(--accent);
}

.catalog-main-card {
  min-height: 104px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 5px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.catalog-main-card:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.catalog-main-card span {
  font-size: 0.95rem;
  font-weight: 800;
}

.catalog-main-card strong {
  font-size: 1.85rem;
  line-height: 1;
}

.catalog-main-card small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.catalog-drilldown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.catalog-drilldown-header > div {
  display: grid;
  gap: 2px;
}

.catalog-drilldown-header strong {
  font-size: 1rem;
}

.catalog-drilldown-header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.catalog-order-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-alt) 72%, transparent);
}

.catalog-order-toolbar.is-dirty {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface));
}

.catalog-order-toolbar > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.catalog-order-toolbar strong {
  font-size: 0.92rem;
}

.catalog-order-toolbar span {
  color: var(--muted);
  font-size: 0.82rem;
}

.catalog-order-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.catalog-order-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--field-bg);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  transform: none;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: var(--accent);
}

input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  background-color: var(--field-bg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  border-radius: 3px;
  box-shadow: none;
  transform: none;
  vertical-align: middle;
  cursor: pointer;
  transition:
    background-color var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

input[type="checkbox"]:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-size: 14px 14px;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.1 8.15L6.75 10.75L11.95 5.25' stroke='white' stroke-width='2.15' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="radio"]:checked {
  border-color: var(--accent);
  background:
    radial-gradient(circle at center, #ffffff 0 35%, transparent 38%),
    var(--accent);
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: none;
  transform: none;
}

input[type="checkbox"]:checked:focus,
input[type="radio"]:checked:focus {
  border-color: var(--accent);
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--info) 42%, transparent);
  outline-offset: 2px;
  transform: none;
}

.tutorial-never input[type="checkbox"]:checked {
  border-color: var(--danger);
  background-color: var(--danger);
}

.autocomplete-field {
  position: relative;
  min-width: 0;
}

.autocomplete-field:focus-within {
  z-index: 45;
}

.autocomplete-menu {
  position: absolute;
  z-index: 5400;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 5px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: sfiFadeIn var(--motion-fast) ease both;
}

.autocomplete-option {
  width: 100%;
  min-height: 44px;
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.autocomplete-option:hover,
.autocomplete-option:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: var(--accent-soft);
}

.autocomplete-option-name {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
}

.autocomplete-option-document {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
}

.autocomplete-option-payment {
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.autocomplete-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.system-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 10, 8, 0.62);
  backdrop-filter: blur(5px);
}

.system-dialog {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
}

.system-dialog-header {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
}

.system-dialog-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--info-soft);
  color: var(--info);
  font-size: 18px;
  font-weight: 900;
}

.system-dialog-warn .system-dialog-icon {
  background: var(--warn-soft);
  color: var(--warn);
}

.system-dialog-danger .system-dialog-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.system-dialog h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
}

.system-dialog-message {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.system-dialog-message p {
  margin: 0 0 6px;
}

.system-dialog-message p:last-child {
  margin-bottom: 0;
}

.system-dialog-field {
  margin-top: 16px;
}

.system-dialog-field textarea {
  min-height: 96px;
}

.system-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.tutorial-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10030;
  display: block;
  padding: 0;
  pointer-events: none;
  background: transparent;
  backdrop-filter: none;
}

.tutorial-card {
  position: fixed;
  top: var(--tutorial-card-top, 92px);
  left: var(--tutorial-card-left, calc(100vw - 456px));
  z-index: 10035;
  width: min(430px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 28px));
  max-height: min(620px, calc(100dvh - 28px));
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--line));
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 22px 68px rgba(0, 0, 0, 0.46);
}

.tutorial-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.tutorial-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--danger);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tutorial-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.18;
}

.tutorial-progress {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  padding: 14px 18px 0;
}

.tutorial-progress button {
  height: 7px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-alt);
  cursor: pointer;
}

.tutorial-progress button.active {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 16%, transparent);
}

.tutorial-body {
  padding: 16px 18px 10px;
}

.tutorial-area {
  width: fit-content;
  margin-bottom: 12px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.tutorial-body > p {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

.tutorial-callout {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--danger) 12%, transparent), transparent 58%),
    var(--surface-alt);
}

.tutorial-callout-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #ffffff;
  font-size: 15px;
  font-weight: 950;
}

.tutorial-callout-copy {
  min-width: 0;
}

.tutorial-callout-copy strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.tutorial-callout-copy p {
  margin: 0;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
}

.tutorial-callout-copy b {
  color: var(--danger);
}

.tutorial-callout .secondary-button {
  grid-column: 1 / -1;
  justify-self: start;
  white-space: nowrap;
}

.tutorial-tips {
  display: grid;
  gap: 10px;
}

.tutorial-tips div {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-alt);
}

.tutorial-tips span {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.tutorial-tips p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.tutorial-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

.tutorial-never {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tutorial-never input {
  width: 16px;
  height: 16px;
}

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

.tutorial-counter {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

html[data-theme="light"] .tutorial-backdrop {
  background: transparent;
}

.tutorial-target-active {
  position: relative !important;
  z-index: 10025 !important;
  pointer-events: auto;
  border-radius: 8px;
  outline: 2px solid color-mix(in srgb, var(--danger) 74%, #ffffff);
  outline-offset: 4px;
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--danger) 18%, transparent),
    0 18px 42px rgba(0, 0, 0, 0.34) !important;
  animation: tutorialTargetPulse 1.45s ease-in-out infinite;
}

@keyframes tutorialTargetPulse {
  0%,
  100% {
    outline-offset: 4px;
    box-shadow:
      0 0 0 8px color-mix(in srgb, var(--danger) 15%, transparent),
      0 18px 42px rgba(0, 0, 0, 0.28);
  }
  50% {
    outline-offset: 7px;
    box-shadow:
      0 0 0 12px color-mix(in srgb, var(--danger) 9%, transparent),
      0 22px 48px rgba(0, 0, 0, 0.34);
  }
}

@media (max-width: 720px) {
  .tutorial-footer,
  .tutorial-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .tutorial-actions > * {
    width: 100%;
  }

  .tutorial-callout {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .tutorial-callout .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.multi-check-dropdown {
  position: relative;
  min-width: 0;
  margin: 0;
  width: 100%;
}

.multi-check-dropdown[open] {
  z-index: 5400;
}

.multi-check-dropdown summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--muted);
  background: var(--field-bg);
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
  transition:
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    background 0.14s ease,
    color 0.14s ease;
}

.multi-check-dropdown summary::-webkit-details-marker {
  display: none;
}

.multi-check-dropdown summary::after {
  content: "v";
  color: var(--muted);
}

.multi-check-dropdown[open] summary {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  transform: none;
}

.multi-check-dropdown summary strong {
  margin-left: auto;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.multi-check-list {
  position: absolute;
  z-index: 5400;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 360px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  transform-origin: top;
  transition: opacity 0.12s ease;
  overscroll-behavior: contain;
}

.multi-check-dropdown[open] .multi-check-list {
  opacity: 1;
  animation: sfiFadeIn var(--motion-fast) ease both;
}

.searchable-multi-check-dropdown .multi-check-list {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  max-height: 340px;
  padding: 0;
  overflow: hidden;
}

.multi-check-search {
  position: sticky;
  z-index: 1;
  top: 0;
  padding: 9px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.multi-check-search input {
  min-height: 36px;
  width: 100%;
}

.searchable-party-field .multi-check-search input {
  padding-right: 36px;
}

.searchable-party-field input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.party-search-clear {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
}

.party-search-clear,
.party-selection-remove {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 5px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.party-search-clear svg,
.party-selection-remove svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.party-search-clear:hover,
.party-selection-remove:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.party-search-results {
  padding: 7px 12px 0;
  color: var(--muted);
  font-size: 11px;
}

.searchable-multi-options {
  display: grid;
  gap: 4px;
  max-height: 276px;
  padding: 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.searchable-party-option {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 7px;
}

.searchable-party-option:hover {
  border-color: var(--line);
  background: var(--surface-alt);
}

.searchable-party-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-soft);
}

.searchable-party-option input[type="checkbox"] {
  flex: 0 0 16px;
  accent-color: var(--accent);
}

.searchable-party-option > span {
  display: grid;
  min-width: 0;
}

.searchable-party-option strong,
.searchable-party-option small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.searchable-party-option strong {
  color: var(--ink);
  font-size: 12px;
}

.searchable-party-option small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
}

.searchable-multi-check-dropdown summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-party-field {
  min-width: 0;
}

.party-selection[hidden],
.party-search-clear[hidden] {
  display: none;
}

.party-selection {
  min-width: 0;
  margin-top: 7px;
}

.party-selection-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--muted);
}

.party-selection-heading strong {
  margin-left: 4px;
  color: var(--ink);
}

.party-selection-clear {
  min-height: 26px;
  border: 0;
  padding: 3px 0 3px 6px;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.party-selection-clear:hover {
  text-decoration: underline;
}

.party-selection-list {
  display: grid;
  gap: 5px;
  max-height: 270px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.party-selection-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 5px 7px 9px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  background: var(--surface-subtle);
}

.party-selection-identity {
  display: grid;
  flex: 1 1 0;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.party-selection-identity strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.4;
}

.party-selection-identity small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.multi-check-option {
  display: flex;
  grid-template-columns: none;
  grid-auto-flow: column;
  gap: 9px;
  align-items: center;
  min-height: 34px;
  min-width: 0;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
}

.multi-check-option input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border-radius: 3px;
}

.multi-check-option span {
  min-width: 0;
}

.single-category-dropdown .multi-check-list {
  width: max(100%, 420px);
  max-height: 300px;
}

.single-category-group-title {
  color: var(--text);
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1.35;
}

.category-tree-option {
  min-height: 34px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  box-shadow: none;
  transition:
    transform var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease;
}

.category-tree-option:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  transform: translateX(2px);
}

.category-tree-option.active {
  border-color: color-mix(in srgb, var(--accent) 56%, var(--line));
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
}

.expense-tree {
  gap: 8px;
}

.expense-tree-group {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-subtle);
}

.expense-tree-group > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  cursor: pointer;
  list-style: none;
}

.expense-tree-group > summary::-webkit-details-marker {
  display: none;
}

.expense-tree-group > summary::after {
  content: "v";
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.expense-tree-group > summary small {
  color: var(--muted);
  font-weight: 700;
}

.expense-tree-search {
  width: calc(100% - 18px);
  min-height: 38px;
  margin: 8px 9px 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--field-text);
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

.expense-tree-search:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.expense-tree-category {
  flex: 1;
  font-weight: 800;
}

.expense-tree-children {
  display: grid;
  gap: 5px;
  padding: 0 9px 9px 28px;
}

.period-filter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: end;
}

.period-filter > label,
.period-filter > .field-block {
  min-width: 0;
}

.period-field-block {
  align-self: start;
}

.period-field-block .period-filter {
  padding: 0;
  border: 0;
  background: transparent;
}

.period-picker {
  position: static;
}

.period-picker[open] {
  position: relative;
  z-index: 5000;
}

.period-summary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: var(--field-bg);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  list-style: none;
  transition:
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    background var(--motion-fast) ease,
    transform var(--motion-fast) var(--motion-ease);
}

.period-summary-button:hover,
.period-picker[open] .period-summary-button {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

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

.period-summary-button::-webkit-details-marker {
  display: none;
}

.period-summary-button::after {
  content: "▾";
  color: var(--muted);
  font-size: 12px;
}

.period-popover {
  position: fixed;
  z-index: 5001;
  top: 92px;
  left: clamp(330px, 22vw, 380px);
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(160px, 190px);
  gap: 14px 16px;
  width: min(760px, calc(100vw - 380px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: sfiFadeIn var(--motion-fast) ease both;
}

.period-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.period-date-grid label:last-child {
  grid-column: 1 / -1;
}

.period-quick-list {
  display: grid;
  gap: 7px;
  align-content: start;
}

.period-quick-list button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  transition:
    transform var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    color var(--motion-fast) ease;
}

.period-quick-list button:hover,
.period-quick-list button.active {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
  transform: translateX(2px);
}

.period-popover-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .multi-check-list {
    width: min(100%, calc(100vw - 48px));
    grid-template-columns: 1fr;
  }

  .period-filter {
    grid-template-columns: 1fr;
  }

  .period-popover {
    left: 16px;
    right: 16px;
    top: 82px;
    width: auto;
    grid-template-columns: 1fr;
  }

  .period-date-grid {
    grid-template-columns: 1fr;
  }
}

.period-summary-button::after {
  content: "v";
}

.period-picker[open]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  animation: sfiFadeIn var(--motion-base) ease both;
}

.period-popover {
  position: fixed;
  z-index: 5001;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 16px;
}

.period-quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.period-quick-list button {
  flex: 1 1 150px;
  text-align: center;
}

.period-popover-actions {
  grid-column: auto;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

@media (max-width: 760px) {
  .period-popover {
    width: min(100%, calc(100vw - 24px));
  }
}

.period-filter {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.period-filter select,
.period-filter .period-summary-button {
  min-height: 38px;
  height: 38px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.period-filter > label > span,
.period-filter .field-label {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.period-picker[open]::before {
  content: none;
  display: none;
}

.period-popover {
  top: var(--period-top, 92px);
  left: var(--period-left, 340px);
  transform: none;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 14px 16px;
  width: var(--period-width, 500px);
  max-height: var(--period-max-height, calc(100dvh - 24px));
  border-radius: 8px;
  padding: 14px;
}

.period-date-grid {
  display: block;
  min-width: 0;
}

.period-visual-panel {
  min-width: 0;
}

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

.period-display-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.period-display-field span {
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.period-display-field strong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 10px;
  background: color-mix(in srgb, var(--field-bg) 88%, var(--surface-alt));
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}

.period-display-field input {
  min-height: 36px;
  height: 36px;
  margin: 0;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.period-calendar,
.period-month-picker {
  display: grid;
  gap: 9px;
}

.period-calendar-header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
}

.period-calendar-header strong {
  color: var(--ink);
  font-size: 13px;
  text-align: center;
  font-weight: 900;
}

.period-calendar-header button {
  display: grid;
  min-height: 28px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.period-calendar-header button:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.period-calendar-header .period-calendar-title {
  width: 100%;
  color: var(--ink);
  font-size: 13px;
  text-align: center;
}

.period-calendar-header .period-calendar-title:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.period-weekdays,
.period-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}

.period-weekdays span {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.period-days button,
.period-month-grid button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  box-shadow: none;
}

.period-days button.current.in-range {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-alt));
}

.date-field-label {
  min-width: 0;
}

.single-date-field {
  display: block;
  min-width: 0;
}

.single-date-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: stretch;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field-bg);
  overflow: hidden;
  transition:
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    background var(--motion-fast) ease;
}

.single-date-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.single-date-control input {
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.single-date-control input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.single-date-toggle {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 38px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  box-shadow: none;
  transition:
    background var(--motion-fast) ease,
    color var(--motion-fast) ease,
    transform var(--motion-fast) var(--motion-ease);
}

.single-date-toggle:hover {
  background: var(--surface-alt);
  color: var(--accent-strong);
  transform: scale(1.04);
}

.single-date-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.month-field-label {
  min-width: 0;
}

.month-field {
  display: block;
  min-width: 0;
}

.month-field-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: stretch;
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0;
  background: var(--field-bg);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
  overflow: hidden;
  transition:
    border-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease,
    background var(--motion-fast) ease;
}

.month-field-control:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--field-bg) 92%, var(--surface-alt));
}

.month-field-control:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.month-field-control [data-month-display] {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 38px;
  padding: 0 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-field-icon {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 38px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  transition:
    background var(--motion-fast) ease,
    color var(--motion-fast) ease,
    transform var(--motion-fast) var(--motion-ease);
}

.month-field-control:hover .month-field-icon {
  background: var(--surface-alt);
  color: var(--accent-strong);
  transform: scale(1.04);
}

.month-field-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.month-field-popover {
  position: fixed;
  z-index: 5200;
  top: var(--month-field-top, 120px);
  left: var(--month-field-left, 24px);
  display: grid;
  gap: 12px;
  width: var(--month-field-width, 300px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  animation: sfiFadeIn var(--motion-fast) var(--motion-ease) both;
  box-shadow: var(--shadow);
}

.standalone-month-picker {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.period-month-range-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.single-date-popover {
  position: fixed;
  z-index: 5200;
  top: var(--single-date-top, 120px);
  left: var(--single-date-left, 24px);
  display: grid;
  gap: 12px;
  width: var(--single-date-width, 300px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  animation: sfiFadeIn var(--motion-fast) var(--motion-ease) both;
  box-shadow: var(--shadow);
}

.single-date-popover .period-calendar {
  min-width: 0;
}

.single-date-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.single-date-actions button {
  flex: 1;
}

.period-days button.muted-day {
  color: color-mix(in srgb, var(--muted) 62%, transparent);
}

.period-days button:hover,
.period-month-grid button:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.period-month-grid button.in-range {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 76%, var(--surface));
  color: var(--accent-strong);
}

.period-days button.active,
.period-month-grid button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

.period-quick-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  align-content: start;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.period-quick-list button {
  flex: none;
  text-align: left;
}

.period-popover-actions {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .period-filter,
  .period-date-grid,
  .period-custom-grid {
    grid-template-columns: 1fr;
  }

  .period-popover {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    grid-template-columns: 1fr;
  }

  .period-quick-list {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  box-shadow: 8px 0 28px rgba(31, 41, 51, 0.04);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 44px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: grid;
  gap: 5px;
}

.main-nav button,
.main-nav a,
.ghost-button,
.secondary-button,
.primary-button,
.danger-button,
.theme-toggle,
.tutorial-launch-button,
.account-menu-toggle {
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 8px 12px;
  font-weight: 700;
  transition:
    transform var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

.main-nav button,
.main-nav a {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}

.main-nav button.active,
.main-nav a.active,
.main-nav button:hover,
.main-nav a:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.main-nav button.active,
.main-nav a.active {
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-group-label {
  margin: 12px 8px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-group-label:first-child {
  margin-top: 0;
}

.nav-icon {
  display: inline-grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 68%, var(--surface));
  color: var(--accent);
  font-weight: 900;
}

.nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main-nav button.active .nav-icon,
.main-nav a.active .nav-icon,
.main-nav button:hover .nav-icon,
.main-nav a:hover .nav-icon {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 82px;
  padding: 18px 28px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.info {
  background: var(--info-soft);
  color: var(--info);
}

.status-pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.neutral {
  background: var(--neutral-soft);
  color: var(--neutral);
}

.status-pill.compact-pill {
  display: inline-flex;
  margin-top: 5px;
}

.app-main {
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 26px clamp(16px, 2vw, 30px) 48px;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.primary-button:hover {
  background: var(--accent-strong);
}

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

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

.danger-button {
  background: var(--button-secondary-bg);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  color: var(--danger);
}

.theme-toggle,
.tutorial-launch-button,
.account-menu-toggle {
  background: var(--button-secondary-bg);
  border-color: var(--line);
  color: var(--ink);
}

.tutorial-launch-button {
  display: inline-grid;
  width: 38px;
  min-width: 38px;
  padding: 0;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.theme-toggle:hover,
.tutorial-launch-button:hover,
.account-menu-toggle:hover,
.row-actions button:hover,
.tabs button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.primary-button:active,
.secondary-button:active,
.ghost-button:active,
.danger-button:active,
.theme-toggle:active,
.tutorial-launch-button:active,
.account-menu-toggle:active,
.row-actions button:active,
.tabs button:active,
.icon-action-button:active {
  transform: translateY(0) scale(0.98);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.result-summary,
.bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 13px;
}

.sync-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: var(--radius);
  padding: 12px 14px;
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.sync-notice strong {
  color: var(--ink);
}

.sync-notice span {
  flex: 1 1 260px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.result-summary strong,
.bulk-actions strong {
  color: var(--ink);
}

.result-summary > strong {
  color: var(--warn);
}

.bulk-actions {
  justify-content: space-between;
  background: var(--accent-soft);
}

.bulk-actions span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

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

.entry-shortcut-focus > div:first-child {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.clear-selection-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--surface) 86%, var(--accent) 14%);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.clear-selection-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.clear-selection-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.warning-box {
  display: grid;
  gap: 7px;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line));
  border-radius: var(--radius);
  padding: 12px;
  background: var(--warn-soft);
  color: var(--warn);
}

.warning-box p {
  margin: 0;
  color: var(--muted);
}

.warning-box.neutral-box {
  border-color: var(--line);
  background: var(--surface-subtle);
  color: var(--text);
}

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

.mini-list span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 6px;
  padding: 7px 8px;
  background: var(--surface);
  color: var(--text);
}

.mini-list button {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--button-secondary-bg);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.compact-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.compact-table table {
  min-width: 720px;
  box-shadow: none;
}

.compact-table th,
.compact-table td {
  padding: 8px 9px;
  font-size: 12px;
}

.cancelled-settlement-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 32%, var(--line));
  border-radius: var(--radius);
  padding: 12px;
  background: var(--danger-soft);
}

.cancelled-settlement-list > strong {
  color: var(--danger);
}

.cancelled-settlement-list div {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  padding: 8px;
  background: var(--surface);
}

.cancelled-settlement-list small {
  color: var(--muted);
}

.list-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  transition: grid-template-columns var(--motion-base) var(--motion-ease), gap var(--motion-base) var(--motion-ease);
}

.list-layout.filters-collapsed {
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
}

.filter-sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  height: calc(100dvh - 92px);
  max-height: calc(100dvh - 92px);
  display: flex;
  flex-direction: column;
  transition:
    width var(--motion-base) var(--motion-ease),
    min-width var(--motion-base) var(--motion-ease),
    border-color var(--motion-base) ease,
    box-shadow var(--motion-base) ease;
}

.filter-sidebar:focus-within {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}

.filter-sidebar:has([data-period-picker][open]) {
  z-index: 5000;
  overflow: visible;
}

.filter-sidebar:has([data-period-picker][open]) .filter-sidebar-body {
  overflow: visible;
}

.filter-sidebar:has([data-autocomplete-menu]:not(.hidden)) {
  z-index: 5000;
  overflow: visible;
}

.filter-sidebar:has([data-autocomplete-menu]:not(.hidden)) .filter-sidebar-body {
  overflow: visible;
}

.filter-sidebar:has(.multi-check-dropdown[open]),
.filter-sidebar:has(.single-category-dropdown[open]) {
  z-index: 5000;
  overflow: visible;
}

.filter-sidebar:has(.multi-check-dropdown[open]) .filter-sidebar-body,
.filter-sidebar:has(.single-category-dropdown[open]) .filter-sidebar-body {
  overflow: visible;
}

.filter-sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 9px;
  border-bottom: 1px solid var(--line);
}

.filter-sidebar-header h3 {
  margin: 0;
  font-size: 1rem;
}

.filter-sidebar-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.filter-sidebar-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
  overflow: auto;
}

.filter-sidebar .form-grid,
.filter-sidebar .filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.filter-sidebar label,
.filter-sidebar .field-label,
.filter-sidebar .field-block > span {
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.filter-sidebar .multi-check-list {
  width: 100%;
  min-width: 0;
}

.filter-sidebar .span-2,
.filter-sidebar .span-4 {
  grid-column: auto;
}

.expense-summary-grouping-field {
  gap: 6px;
}

.expense-summary-month-range {
  gap: 6px;
}

.expense-summary-month-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.expense-summary-month-range-fields .month-field-label {
  min-width: 0;
}

.expense-summary-month-range-fields .month-field-control > [data-month-display] {
  min-width: 0;
  padding-inline: 9px 5px;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-summary-month-range-fields .month-field-icon {
  min-width: 34px;
}

.expense-summary-grouping {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field-bg);
}

.expense-summary-grouping label {
  min-width: 0;
  cursor: pointer;
}

.expense-summary-grouping input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.expense-summary-grouping label > span {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}

.expense-summary-grouping input:checked + span {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}

.expense-summary-grouping input:focus-visible + span {
  outline: 2px solid color-mix(in srgb, var(--accent) 62%, transparent);
  outline-offset: 1px;
}

.filter-inline-row {
  display: grid;
  grid-template-columns: minmax(82px, 0.75fr) minmax(0, 1.25fr);
  gap: 7px;
  align-items: end;
  min-width: 0;
}

.filter-sidebar .filter-inline-row label {
  min-width: 0;
}

.filter-sidebar .value-document-row input {
  min-height: 34px;
  height: 34px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.filter-sidebar .form-actions {
  position: sticky;
  z-index: 1;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 8px;
  transition: background var(--motion-base) ease, border-color var(--motion-base) ease;
}

.filter-sidebar.collapsed {
  width: 52px;
  min-width: 52px;
}

.filter-sidebar.collapsed .filter-sidebar-header {
  padding: 10px;
  border-bottom: 0;
}

.filter-sidebar.collapsed .filter-sidebar-header div,
.filter-sidebar.collapsed .filter-sidebar-body {
  display: none;
}

.filter-sidebar.collapsed + .list-main {
  min-width: 0;
}

.list-main {
  min-width: 0;
  container-type: inline-size;
}

.select-cell {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.select-cell input {
  width: 16px;
  min-height: 16px;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

[data-payable-select],
[data-receivable-select] {
  cursor: pointer;
  touch-action: none;
}

.payable-entry-table tr.is-selection-dragged,
.receivables-entry-table tr.is-selection-dragged,
.payable-entry-table tbody tr:has([data-payable-select]:checked),
.receivables-entry-table tbody tr:has([data-receivable-select]:checked) {
  background: color-mix(in srgb, var(--accent) 12%, var(--table-row-hover));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 76%, transparent);
}

.is-entry-selection-dragging,
.is-entry-selection-dragging * {
  user-select: none;
}

body.entry-selection-dragging {
  cursor: crosshair;
  user-select: none;
}

.inline-check {
  min-height: 40px;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
}

.inline-check input {
  width: 16px;
  min-height: 16px;
}

.compact-details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  padding: 0;
  overflow: hidden;
}

.compact-details summary {
  cursor: pointer;
  padding: 11px 13px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.compact-details .form-grid {
  padding: 0 13px 13px;
}

.installment-config > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.installment-config > summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.installment-config-body {
  display: grid;
  gap: 14px;
  padding: 0 13px 13px;
}

.installment-config-options {
  display: grid;
  grid-template-columns: minmax(120px, 0.55fr) minmax(0, 1.45fr);
  align-items: end;
  gap: 12px;
}

.installment-mode-field {
  gap: 6px;
}

.installment-mode-control {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
}

.installment-mode-control label {
  min-width: 0;
  cursor: pointer;
}

.installment-mode-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.installment-mode-control label > span {
  min-height: 48px;
  display: grid;
  align-content: center;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--muted);
}

.installment-mode-control label > span strong {
  color: inherit;
  font-size: 12px;
}

.installment-mode-control label > span small {
  min-width: 0;
  font-size: 10px;
  line-height: 1.25;
}

.installment-mode-control input:checked + span {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 72%, var(--surface));
  color: var(--accent-strong);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.installment-mode-control input:focus-visible + span {
  outline: 2px solid color-mix(in srgb, var(--accent) 62%, transparent);
  outline-offset: 1px;
}

.fixed-installment-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fixed-installment-preview > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.fixed-installment-preview > div + div {
  border-left: 1px solid var(--line);
}

.fixed-installment-preview span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.fixed-installment-preview strong {
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.installment-schedule {
  display: grid;
  gap: 10px;
}

.installment-schedule-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.installment-schedule-summary {
  display: grid;
  gap: 2px;
}

.installment-schedule-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.installment-schedule-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.installment-schedule-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.installment-schedule-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.installment-schedule-tools svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.installment-schedule-grid {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.installment-schedule-head,
.installment-schedule-row {
  min-width: 460px;
  display: grid;
  grid-template-columns: 72px minmax(160px, 1fr) minmax(140px, 0.85fr);
  align-items: center;
  gap: 10px;
}

.installment-schedule-head {
  min-height: 34px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.installment-schedule-body {
  min-width: 460px;
  max-height: 390px;
  overflow-y: auto;
}

.installment-schedule-row {
  min-height: 48px;
  padding: 6px 10px;
}

.installment-schedule-row + .installment-schedule-row {
  border-top: 1px solid var(--line);
}

.installment-schedule-row:focus-within {
  background: color-mix(in srgb, var(--accent-soft) 34%, var(--surface));
}

.installment-schedule-row input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  height: 34px;
  padding: 6px 9px;
  font-size: 12px;
}

.installment-number {
  color: var(--accent-strong);
  font-size: 12px;
}

.existing-installment-series {
  display: grid;
  gap: 4px;
  padding: 0 13px 13px;
}

.existing-installment-series strong {
  color: var(--ink);
  font-size: 12px;
}

.existing-installment-series span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .installment-config-options {
    grid-template-columns: 1fr;
  }

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

  .fixed-installment-preview > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .fixed-installment-preview > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .installment-schedule-toolbar {
    align-items: flex-start;
  }
}

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

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

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

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

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  transition:
    border-color var(--motion-base) ease,
    box-shadow var(--motion-base) ease,
    background var(--motion-base) ease;
}

.panel + .panel {
  margin-top: 18px;
}

.panel:hover {
  border-color: color-mix(in srgb, var(--accent) 16%, var(--line));
}

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

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

.list-header-controls {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-left: 10px;
}

.list-header-controls.actions-only {
  justify-content: flex-end;
}

.entry-kind-quick-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.entry-kind-quick-switch > span {
  padding-left: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.entry-kind-quick-switch > div {
  display: inline-flex;
  gap: 3px;
}

.entry-kind-quick-switch button {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform var(--motion-fast) var(--motion-ease),
    background 0.16s ease,
    color 0.16s ease;
}

.entry-kind-quick-switch button:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.entry-kind-quick-switch button.active {
  color: var(--button-fg);
  background: var(--accent);
  transform: translateY(-1px);
}

.section-title h3 {
  color: var(--ink);
  font-size: 18px;
}

.section-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  animation: sfiSoftRise var(--motion-base) var(--motion-ease) both;
  transition:
    transform var(--motion-base) var(--motion-ease),
    border-color var(--motion-base) ease,
    box-shadow var(--motion-base) ease,
    background var(--motion-base) ease;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
  transition: width var(--motion-base) var(--motion-ease), background var(--motion-base) ease;
}

.kpi:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  box-shadow: var(--shadow);
}

.kpi:hover::before {
  width: 6px;
}

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

.kpi strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(20px, 2vw, 25px);
  letter-spacing: 0;
}

.kpi strong.positive {
  color: var(--success);
}

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

.kpi strong.warn {
  color: var(--warn);
}

.dashboard-alert-panel {
  margin-bottom: 18px;
}

.dashboard-alert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.dashboard-alert-card {
  min-height: 114px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-subtle) 92%, transparent), var(--surface));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.dashboard-alert-card:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.dashboard-alert-card span,
.dashboard-alert-card small,
.dashboard-alert-card em,
.dashboard-alert-card strong {
  display: block;
}

.dashboard-alert-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-alert-card strong {
  align-self: end;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.dashboard-alert-card small {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-alert-card em {
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.dashboard-alert-card.danger {
  border-color: color-mix(in srgb, var(--danger) 50%, var(--line));
}

.dashboard-alert-card.danger strong {
  color: var(--danger);
}

.dashboard-alert-card.warn {
  border-color: color-mix(in srgb, var(--warn) 48%, var(--line));
}

.dashboard-alert-card.warn strong {
  color: var(--warn);
}

.dashboard-alert-card.success strong {
  color: var(--success);
}

.dashboard-alert-card.info strong {
  color: var(--accent);
}

.entry-drawer.missing-data-review-drawer {
  width: min(860px, 64vw);
  min-width: 0;
  overflow: hidden;
}

.missing-data-review-body {
  width: 100%;
  min-width: 0;
  padding: 20px 22px 28px;
  overflow-x: hidden;
}

.missing-data-review-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  margin-bottom: 16px;
  border-block: 1px solid var(--line);
}

.missing-data-review-stats > div {
  min-width: 0;
  padding: 14px 16px;
}

.missing-data-review-stats > div + div {
  border-left: 1px solid var(--line);
}

.missing-data-review-stats span,
.missing-data-review-stats strong {
  display: block;
}

.missing-data-review-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.missing-data-review-stats strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 22px;
}

.missing-data-review-tabs {
  max-width: 100%;
  margin-bottom: 10px;
}

.missing-data-review-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.missing-data-review-tabs button span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: inherit;
  font-size: 10px;
}

.missing-data-review-tabs button.active span {
  background: color-mix(in srgb, var(--surface) 24%, transparent);
}

.missing-data-review-list {
  display: grid;
  width: 100%;
  min-width: 0;
}

.missing-data-review-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 18px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}

.missing-data-review-main {
  min-width: 0;
}

.missing-data-review-main > strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.missing-data-review-title,
.missing-data-review-meta,
.missing-data-issues {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.missing-data-collection {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.missing-data-review-meta {
  margin-top: 9px;
  gap: 7px 18px;
  color: var(--muted);
  font-size: 12px;
}

.missing-data-review-meta span {
  display: inline-flex;
  gap: 5px;
}

.missing-data-review-meta b {
  color: var(--text);
}

.missing-data-issues {
  margin-top: 10px;
}

.missing-data-issue {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--warn) 48%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
  color: color-mix(in srgb, var(--warn) 72%, var(--ink));
  font-size: 11px;
  font-weight: 850;
}

.missing-data-edit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 104px;
}

.missing-data-edit-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.entry-drawer.recurrence-renewal-drawer {
  width: min(900px, 68vw);
  min-width: 0;
  overflow: hidden;
}

.recurrence-renewal-body {
  padding: 0 22px 24px;
}

.recurrence-renewal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.recurrence-renewal-summary > div {
  min-width: 0;
  padding: 15px 12px;
}

.recurrence-renewal-summary > div + div {
  border-left: 1px solid var(--line);
}

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

.recurrence-renewal-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.recurrence-renewal-summary strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 21px;
}

.recurrence-renewal-select-all {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.recurrence-renewal-list {
  display: grid;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.recurrence-renewal-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 16px 2px;
  border-bottom: 1px solid var(--line);
}

.recurrence-renewal-check {
  display: grid;
  width: 28px;
  min-height: 36px;
  place-items: center;
}

.recurrence-renewal-main {
  min-width: 0;
}

.recurrence-renewal-title,
.recurrence-renewal-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 14px;
}

.recurrence-renewal-title strong {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.recurrence-renewal-main > p {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.recurrence-renewal-meta {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.recurrence-renewal-meta b {
  color: var(--text);
}

.recurrence-renewal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.recurrence-renewal-footer > span {
  color: var(--muted);
  font-size: 12px;
}

.recurrence-renewal-footer > div {
  display: flex;
  gap: 8px;
}

.recurrence-renewal-draft-notice {
  border-color: color-mix(in srgb, var(--success) 42%, var(--line));
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
}

@media (max-width: 800px) {
  .entry-drawer.recurrence-renewal-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .recurrence-renewal-body {
    padding: 0 16px 20px;
  }

  .recurrence-renewal-summary > div {
    padding: 12px 8px;
  }

  .recurrence-renewal-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .recurrence-renewal-item > button {
    grid-column: 2;
    width: 100%;
  }

  .recurrence-renewal-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 16px;
  }

  .recurrence-renewal-footer > div,
  .recurrence-renewal-footer button {
    width: 100%;
  }
}

.bank-limit-editor {
  display: grid;
  gap: 14px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.bank-limit-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.bank-limit-editor-header > div:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.bank-limit-editor-header > div:first-child strong {
  color: var(--ink);
  font-size: 14px;
}

.bank-limit-editor-header > div:first-child span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.bank-limit-editor-header > div:last-child {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.bank-limit-editor-header button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.bank-limit-editor-header button svg,
.bank-limit-remove-rule svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.bank-limit-rule-list {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.bank-limit-rule-line {
  display: grid;
  grid-template-columns: minmax(180px, 1.45fr) minmax(140px, 1fr) minmax(145px, .8fr) 40px;
  align-items: end;
  min-width: 0;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-subtle);
}

.bank-limit-rule-line label {
  min-width: 0;
}

.bank-limit-remove-rule {
  display: grid;
  width: 40px;
  min-width: 40px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  place-items: center;
  color: var(--danger);
}

.bank-limit-rule-usage {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.bank-limit-rule-usage > div {
  display: grid;
  gap: 2px;
}

.bank-limit-rule-usage strong {
  color: var(--ink);
  font-size: 12px;
}

.bank-limit-rule-usage.near > span {
  color: var(--warn);
  font-weight: 850;
}

.bank-limit-rule-usage.exceeded > span {
  color: var(--danger);
  font-weight: 850;
}

.bank-limit-empty-state {
  min-height: 72px;
}

.bank-limit-catalog-summary {
  display: grid;
  width: max-content;
  min-width: 118px;
  gap: 2px;
}

.bank-limit-catalog-summary strong {
  color: var(--ink);
  font-size: 12px;
}

.bank-limit-catalog-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.bank-limit-catalog-summary.near span {
  color: var(--warn);
}

.bank-limit-catalog-summary.exceeded span {
  color: var(--danger);
}

.bank-limit-catalog-summary.ok span {
  color: var(--success);
}

.bank-limit-projection {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-subtle);
}

.bank-limit-projection.hidden {
  display: none;
}

.bank-limit-projection-header > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.bank-limit-projection-header strong {
  color: var(--ink);
  font-size: 13px;
}

.bank-limit-projection-header span,
.bank-limit-projection-empty {
  color: var(--muted);
  font-size: 11px;
}

.bank-limit-projection-list {
  display: grid;
}

.bank-limit-projection-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.bank-limit-projection-copy,
.bank-limit-projection-values {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.bank-limit-projection-copy strong,
.bank-limit-projection-values strong {
  color: var(--ink);
  font-size: 12px;
}

.bank-limit-projection-copy span,
.bank-limit-projection-values span {
  color: var(--muted);
  font-size: 10px;
}

.bank-limit-projection-values {
  text-align: right;
}

.bank-limit-projection-row.near .bank-limit-projection-values span {
  color: var(--warn);
  font-weight: 850;
}

.bank-limit-projection-row.exceeded .bank-limit-projection-values span {
  color: var(--danger);
  font-weight: 850;
}

.bank-limit-progress {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
}

.bank-limit-progress span {
  display: block;
  height: 100%;
  background: var(--success);
}

.bank-limit-projection-row.near .bank-limit-progress span {
  background: var(--warn);
}

.bank-limit-projection-row.exceeded .bank-limit-progress span {
  background: var(--danger);
}

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

.closure-year-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-subtle) 80%, var(--surface));
  overflow: hidden;
}

.closure-year-summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
}

.closure-year-summary::-webkit-details-marker {
  display: none;
}

.closure-year-summary::after {
  content: "v";
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-weight: 900;
}

.closure-year-card[open] .closure-year-summary::after {
  content: "^";
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

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

.closure-year-summary strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
}

.closure-year-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.closure-year-metrics {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.closure-year-metrics span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
}

.closure-month-table-wrap {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.closure-month-table th,
.closure-month-table td {
  vertical-align: middle;
}

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

.filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}

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

.span-4 {
  grid-column: span 4;
}

.permission-grid {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-subtle) 82%, transparent);
}

.permission-grid legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.permission-grid p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.permission-group-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  padding: 11px;
}

.permission-group-title {
  display: grid;
  gap: 2px;
  margin-bottom: 9px;
}

.permission-group-title strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.permission-group-title small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.permission-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.permission-option {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.permission-option input {
  width: 16px;
  min-height: 16px;
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .permission-groups {
    grid-template-columns: 1fr;
  }
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.compact-actions {
  margin-top: 10px;
}

.section-actions.compact-actions {
  margin-top: 0;
}

.export-action-groups {
  align-items: center;
  gap: 8px;
}

.export-action-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 4px 6px 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-subtle) 84%, transparent);
}

.export-action-group > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.export-action-group > div {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.inline-export-group {
  background: transparent;
}

.icon-action-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 56%, var(--surface));
  color: var(--accent-strong);
  box-shadow: none;
}

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

.icon-action-button:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  border-color: var(--accent);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.icon-action-button.excel-action {
  color: var(--success);
}

.icon-action-button.pdf-action {
  color: var(--accent-strong);
}

html[data-theme="dark"] .icon-action-button:hover {
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 24%, var(--surface));
}

.report-custom-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(360px, 1.1fr) minmax(300px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.report-column-list,
.selected-column-list {
  display: grid;
  gap: 9px;
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-subtle);
}

.report-column-list .multi-check-option {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 8px 10px;
}

.report-column-list .multi-check-option:hover {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-alt) 72%, transparent);
}

.selected-column-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 8px 2px 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.selected-column-item > span:not(.drag-handle) {
  min-width: 0;
}

.selected-column-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.selected-column-item .row-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  gap: 7px;
}

.selected-column-item .row-actions button {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.selected-column-list .compact-empty {
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.template-controls {
  display: grid;
  gap: 10px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.report-table-wrap {
  max-width: 100%;
  max-height: clamp(320px, 58dvh, 680px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: var(--line-strong) var(--surface-alt);
}

.report-table-wrap::-webkit-scrollbar {
  width: 11px;
  height: 12px;
}

.report-table-wrap::-webkit-scrollbar-track {
  background: var(--surface-alt);
}

.report-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid var(--surface-alt);
  border-radius: 6px;
  background: var(--line-strong);
}

.report-table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.report-table-wrap table {
  width: max(100%, calc(var(--report-column-count, 1) * 145px));
  min-width: 100%;
  table-layout: fixed;
}

.report-table-wrap th {
  position: sticky;
  z-index: 3;
  top: 0;
  background: var(--surface-alt);
  box-shadow: inset 0 -1px 0 var(--line-strong);
  line-height: 1.25;
  white-space: normal;
}

.report-table-wrap th,
.report-table-wrap td {
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-table-wrap tfoot td {
  position: sticky;
  z-index: 2;
  bottom: 0;
  background: var(--surface-alt);
  box-shadow: inset 0 1px 0 var(--line-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  font-variant-numeric: tabular-nums;
}

.catalog-supplier-table {
  min-width: 860px;
}

.catalog-supplier-table th,
.catalog-supplier-table td {
  vertical-align: middle;
}

.catalog-party-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.catalog-party-cell strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.catalog-party-cell span,
.catalog-party-cell small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.catalog-party-cell.compact strong {
  font-size: 12.5px;
}

.catalog-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: color-mix(in srgb, var(--success) 18%, transparent);
  color: var(--success);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.catalog-status.is-inactive {
  background: color-mix(in srgb, var(--muted) 16%, transparent);
  color: var(--muted);
}

.payable-entry-table {
  min-width: 0;
  table-layout: fixed;
}

.payable-entry-table th,
.payable-entry-table td {
  padding: 8px 7px;
  font-size: 11.5px;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.payable-entry-table th:nth-child(1) { width: 13%; }
.payable-entry-table th:nth-child(2) { width: 8%; }
.payable-entry-table th:nth-child(3) { width: 7%; }
.payable-entry-table th:nth-child(4) { width: 14%; }
.payable-entry-table th:nth-child(5) { width: 8%; }
.payable-entry-table th:nth-child(6) { width: 8%; }
.payable-entry-table th:nth-child(7) { width: 5%; }
.payable-entry-table th:nth-child(8) { width: 7%; }
.payable-entry-table th:nth-child(9) { width: 7%; }
.payable-entry-table th:nth-child(10) { width: 9%; }
.payable-entry-table th:nth-child(11) { width: 7%; }
.payable-entry-table th:nth-child(12) { width: 92px; }

.payable-entry-table th:nth-child(2),
.payable-entry-table th:nth-child(3),
.payable-entry-table th:nth-child(5),
.payable-entry-table th:nth-child(6),
.payable-entry-table th:nth-child(7),
.payable-entry-table th:nth-child(8),
.payable-entry-table th:nth-child(9),
.payable-entry-table th:nth-child(10),
.payable-entry-table th:nth-child(11),
.payable-entry-table th:nth-child(12),
.payable-entry-table td:nth-child(2),
.payable-entry-table td:nth-child(3),
.payable-entry-table td:nth-child(5),
.payable-entry-table td:nth-child(6),
.payable-entry-table td:nth-child(7),
.payable-entry-table td:nth-child(8),
.payable-entry-table td:nth-child(9),
.payable-entry-table td:nth-child(10),
.payable-entry-table td:nth-child(11),
.payable-entry-table td:nth-child(12) {
  text-align: center;
}

.payable-entry-table td:nth-child(4) {
  text-align: left;
}

.payable-entry-table .row-actions {
  min-width: 86px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.payable-entry-table .row-actions button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

.payable-entry-table .row-more-menu summary {
  flex: 0 0 30px;
  width: 30px;
  min-height: 28px;
}

.payable-entry-table td:nth-child(12) {
  overflow: visible;
}

.payable-entry-table td.value-cell {
  text-align: center;
}

.payable-entry-table .status-pill {
  min-height: 24px;
  padding: 4px 7px;
  font-size: 11px;
}

.payable-entry-table .value-stack strong {
  font-size: 12px;
}

.payable-entry-table .value-stack {
  justify-items: center;
  text-align: center;
}

.payable-entry-table td:nth-child(11) .status-pill {
  justify-content: center;
  margin-inline: auto;
}

.finance-entry-table th,
.finance-entry-table td {
  vertical-align: middle;
}

.finance-entry-table th:last-child,
.finance-entry-table td:last-child {
  padding-left: 4px;
  padding-right: 14px;
}

.finance-entry-table td:last-child {
  overflow: visible;
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.table-sort-button:hover,
.table-sort-button.active {
  color: var(--accent-strong);
}

.table-sort-button .sort-arrow {
  flex: 0 0 auto;
  color: currentColor;
  font-size: 12px;
  line-height: 1;
}

.receivables-entry-table {
  min-width: 0;
  table-layout: fixed;
}

.receivables-entry-table th,
.receivables-entry-table td {
  padding: 6px 6px;
  font-size: 11px;
  overflow-wrap: anywhere;
  line-height: 1.28;
}

.receivables-entry-table th:nth-child(1) { width: 34px; }
.receivables-entry-table th:nth-child(2) { width: 13%; }
.receivables-entry-table th:nth-child(3) { width: 24%; }
.receivables-entry-table th:nth-child(4) { width: 8%; }
.receivables-entry-table th:nth-child(5) { width: 5%; }
.receivables-entry-table th:nth-child(6) { width: 7%; }
.receivables-entry-table th:nth-child(7) { width: 7%; }
.receivables-entry-table th:nth-child(8) { width: 14%; }
.receivables-entry-table th:nth-child(9) { width: 9%; }
.receivables-entry-table th:nth-child(10) { width: 7%; }
.receivables-entry-table th:nth-child(11) { width: 92px; }

.receivables-entry-table th:nth-child(1),
.receivables-entry-table th:nth-child(4),
.receivables-entry-table th:nth-child(5),
.receivables-entry-table th:nth-child(6),
.receivables-entry-table th:nth-child(7),
.receivables-entry-table th:nth-child(8),
.receivables-entry-table th:nth-child(9),
.receivables-entry-table th:nth-child(10),
.receivables-entry-table th:nth-child(11),
.receivables-entry-table td:nth-child(1),
.receivables-entry-table td:nth-child(4),
.receivables-entry-table td:nth-child(5),
.receivables-entry-table td:nth-child(6),
.receivables-entry-table td:nth-child(7),
.receivables-entry-table td:nth-child(8),
.receivables-entry-table td:nth-child(10),
.receivables-entry-table td:nth-child(11) {
  text-align: center;
}

.receivables-entry-table td:nth-child(9) {
  text-align: center;
}

.receivables-entry-table .receivable-value-stack {
  justify-items: center;
  text-align: center;
}

.receivables-entry-table td:nth-child(11) {
  overflow: visible;
}

.receivables-entry-table .row-actions {
  min-width: 0;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
}

.receivables-entry-table .row-actions button {
  min-width: 48px;
  min-height: 26px;
  padding: 3px 6px;
  font-size: 10.5px;
  line-height: 1.15;
  white-space: nowrap;
}

.receivables-entry-table .row-more-menu summary {
  width: 26px;
  min-height: 26px;
}

.row-actions {
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 5px;
}

.row-icon-action,
.row-actions .row-icon-action {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 30px;
  min-width: 31px;
  min-height: 30px;
  padding: 0;
  border-radius: 7px;
}

.row-icon-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row-icon-action.settle-action {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 34%, var(--line));
}

.row-icon-action.history-action {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
}

.row-icon-action.copy-action {
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 42%, var(--line));
  background: color-mix(in srgb, var(--info) 8%, transparent);
}

.copied-classification-note {
  display: grid;
  gap: 3px;
  border-left: 3px solid var(--info);
  padding: 8px 10px;
  background: var(--info-soft);
  color: var(--text);
  font-size: 11px;
}

.copied-classification-note span,
.copied-classification-note small {
  color: var(--muted);
}

.copied-classification-note strong {
  color: var(--info);
  overflow-wrap: anywhere;
}

.row-icon-action.danger-action {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.cash-movement-table .cash-actions-cell {
  width: 148px;
  min-width: 148px;
  text-align: center;
}

.cash-row-end-tools {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
}

.cash-movement-table .cash-row-actions {
  min-width: 0;
  justify-content: center;
}

.cash-source-indicator {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.cash-source-indicator:hover {
  filter: brightness(1.18);
}

.cash-source-indicator:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.cash-source-indicator-payables {
  color: var(--accent-strong);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.cash-source-indicator-receivables {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 16%, transparent);
}

.cash-source-indicator-cash-banks {
  color: var(--info);
  background: color-mix(in srgb, var(--info) 16%, transparent);
}

.payable-entry-table th:nth-child(1) { width: 12%; }
.payable-entry-table th:nth-child(2) { width: 7%; }
.payable-entry-table th:nth-child(3) { width: 6%; }
.payable-entry-table th:nth-child(4) { width: 14%; }
.payable-entry-table th:nth-child(5) { width: 6%; }
.payable-entry-table th:nth-child(6) { width: 10%; }
.payable-entry-table th:nth-child(7) { width: 7%; }
.payable-entry-table th:nth-child(8) { width: 7%; }
.payable-entry-table th:nth-child(9) { width: 4.5%; }
.payable-entry-table th:nth-child(10) { width: 6.5%; }
.payable-entry-table th:nth-child(11) { width: 6.5%; }
.payable-entry-table th:nth-child(12) { width: 7%; }
.payable-entry-table th:nth-child(13) { width: 6%; }
.payable-entry-table th:nth-child(14) { width: 128px; }

.payable-entry-table th:nth-child(n+2):not(:nth-child(4)):not(:nth-child(6)),
.payable-entry-table td:nth-child(n+2):not(:nth-child(4)):not(:nth-child(6)) {
  text-align: center;
}

.payable-entry-table td:nth-child(4),
.payable-entry-table td:nth-child(6) {
  text-align: left;
}

.payable-entry-table td:nth-child(14),
.receivables-entry-table td:nth-child(14) {
  overflow: visible;
}

.payable-entry-table td:nth-child(13) .status-pill,
.receivables-entry-table td:nth-child(13) .status-pill {
  justify-content: center;
  margin-inline: auto;
}

.payable-entry-table .row-actions,
.receivables-entry-table .row-actions {
  min-width: 0;
  width: 100%;
  gap: 4px;
  flex-wrap: nowrap;
}

.payable-entry-table .row-actions button,
.receivables-entry-table .row-actions button {
  min-width: 31px;
  min-height: 30px;
  padding: 0;
  font-size: 0;
}

.payable-entry-table .row-actions .row-more-menu button,
.receivables-entry-table .row-actions .row-more-menu button {
  width: 100%;
  min-width: 150px;
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.receivables-entry-table th:nth-child(1) { width: 32px; }
.receivables-entry-table th:nth-child(2) { width: 12%; }
.receivables-entry-table th:nth-child(3) { width: 7%; }
.receivables-entry-table th:nth-child(4) { width: 11%; }
.receivables-entry-table th:nth-child(5) { width: 13%; }
.receivables-entry-table th:nth-child(6) { width: 6%; }
.receivables-entry-table th:nth-child(7) { width: 9%; }
.receivables-entry-table th:nth-child(8) { width: 7%; }
.receivables-entry-table th:nth-child(9) { width: 4.5%; }
.receivables-entry-table th:nth-child(10) { width: 6.5%; }
.receivables-entry-table th:nth-child(11) { width: 6.5%; }
.receivables-entry-table th:nth-child(12) { width: 7%; }
.receivables-entry-table th:nth-child(13) { width: 6%; }
.receivables-entry-table th:nth-child(14) { width: 128px; }

.receivables-entry-table th:nth-child(1),
.receivables-entry-table th:nth-child(3),
.receivables-entry-table th:nth-child(4),
.receivables-entry-table th:nth-child(6),
.receivables-entry-table th:nth-child(8),
.receivables-entry-table th:nth-child(9),
.receivables-entry-table th:nth-child(10),
.receivables-entry-table th:nth-child(11),
.receivables-entry-table th:nth-child(12),
.receivables-entry-table th:nth-child(13),
.receivables-entry-table th:nth-child(14),
.receivables-entry-table td:nth-child(1),
.receivables-entry-table td:nth-child(3),
.receivables-entry-table td:nth-child(4),
.receivables-entry-table td:nth-child(6),
.receivables-entry-table td:nth-child(8),
.receivables-entry-table td:nth-child(9),
.receivables-entry-table td:nth-child(10),
.receivables-entry-table td:nth-child(11),
.receivables-entry-table td:nth-child(12),
.receivables-entry-table td:nth-child(13),
.receivables-entry-table td:nth-child(14) {
  text-align: center;
}

.receivables-entry-table td:nth-child(5),
.receivables-entry-table td:nth-child(7) {
  text-align: left;
}

.payable-entry-table th,
.receivables-entry-table th {
  text-align: center;
  vertical-align: middle;
}

.payable-entry-table thead .select-cell {
  position: relative;
  justify-content: center;
  width: 100%;
  text-align: center;
}

.payable-entry-table thead .select-cell input {
  position: absolute;
  left: 0;
}

.payable-entry-table tbody .select-cell {
  justify-content: flex-start;
  text-align: left;
}

.party-entry-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.party-entry-cell > input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
}

.party-entry-name {
  display: grid;
  min-width: 0;
  gap: 2px;
  overflow-wrap: anywhere;
}

.party-entry-name small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.party-info-button {
  display: inline-grid;
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 5px;
  padding: 0;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--accent-strong);
}

.party-info-button:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 17%, var(--surface));
  color: var(--ink);
}

.party-info-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.payable-allocation-indicator {
  display: inline-grid;
  flex: 0 0 20px;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid #34485d;
  border-radius: 4px;
  background: #203246;
  color: #fff2c7;
  box-shadow: 0 1px 2px rgba(15, 23, 32, 0.18);
  cursor: help;
}

.payable-allocation-indicator svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.payable-entry-table td:nth-child(1),
.payable-entry-table td:nth-child(4),
.receivables-entry-table td:nth-child(2),
.receivables-entry-table td:nth-child(5) {
  text-align: left;
}

.payable-entry-table td:nth-child(n+2):not(:nth-child(4)),
.receivables-entry-table td:nth-child(1),
.receivables-entry-table td:nth-child(3),
.receivables-entry-table td:nth-child(4),
.receivables-entry-table td:nth-child(6),
.receivables-entry-table td:nth-child(7),
.receivables-entry-table td:nth-child(8),
.receivables-entry-table td:nth-child(9),
.receivables-entry-table td:nth-child(10),
.receivables-entry-table td:nth-child(11),
.receivables-entry-table td:nth-child(12),
.receivables-entry-table td:nth-child(13),
.receivables-entry-table td:nth-child(14) {
  text-align: center;
}

.payable-entry-table td:nth-child(13) .status-pill,
.receivables-entry-table td:nth-child(13) .status-pill,
.payable-entry-table td:nth-child(14) .row-actions,
.receivables-entry-table td:nth-child(14) .row-actions {
  margin-inline: auto;
}

.receivable-fiscal-card {
  display: grid;
  gap: 4px;
  padding: 5px 6px;
  width: max-content;
  min-width: 112px;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-subtle) 82%, var(--surface) 18%);
  text-align: left;
}

.fiscal-card-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.receivable-fiscal-card:not(.iss-only) .fiscal-card-row {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  column-gap: 6px;
}

.receivable-fiscal-card.iss-only .fiscal-card-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 6px;
}

.receivable-fiscal-card.iss-only .fiscal-card-row > div,
.receivable-fiscal-card.iss-only .fiscal-card-row > span:not(.fiscal-tag):not(.iss-status-icon) {
  align-self: center;
  font-weight: 800;
}

.fiscal-card-row > div {
  display: grid;
  gap: 1px;
  min-width: max-content;
}

.fiscal-card-row strong,
.fiscal-card-row span {
  min-width: 0;
}

.fiscal-card-row.linked strong {
  color: var(--success);
}

.fiscal-card-row span:not(.fiscal-tag):not(.iss-status-icon) {
  color: var(--muted);
  font-size: 10px;
}

.fiscal-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 24px;
  height: 19px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 9px;
}

.receivable-fiscal-card:not(.iss-only) .fiscal-tag {
  width: auto;
  min-width: 31px;
  height: 19px;
  border-radius: 999px;
  font-size: 8px;
  padding: 0 4px;
}

.receivable-fiscal-card:not(.iss-only) .fiscal-tag.linked,
.receivable-fiscal-card:not(.iss-only) .tax-tag.linked {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 16%, transparent);
}

.receivable-fiscal-card:not(.iss-only) .tax-tag {
  color: var(--muted);
  background: color-mix(in srgb, var(--line) 48%, transparent);
}

.receivable-fiscal-card:not(.iss-only) .tax-value-row strong {
  color: var(--ink);
}

.iss-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 11px;
}

.iss-status-icon.linked {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 16%, transparent);
}

.iss-status-icon.unlinked {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--table-head);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--line);
}

tbody tr {
  transition:
    background var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

tbody tr:hover {
  background: var(--table-row-hover);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 44%, transparent);
}

tbody tr.clickable-row {
  cursor: pointer;
}

tr:last-child td {
  border-bottom: 0;
}

tfoot td {
  background: var(--table-head);
  color: var(--ink);
}

td.money,
td:has(.money) {
  text-align: right;
}

.value-cell {
  min-width: 132px;
}

.money,
.value-cell,
.value-cell *,
.value-stack,
.value-stack *,
.receivable-value-stack,
.receivable-value-stack *,
.fiscal-card-row strong,
.summary-value,
.metric-value,
.dashboard-card strong,
.total-line strong {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

td.money,
td:has(.money),
td.value-cell {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

.value-stack {
  display: grid;
  gap: 2px;
  justify-items: end;
  line-height: 1.25;
}

.value-stack strong {
  color: var(--ink);
  font-size: 13px;
}

.value-stack span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.value-stack small {
  color: var(--muted);
  font-size: 11px;
}

.value-stack small.paid-value {
  color: var(--success);
  font-weight: 800;
}

.value-stack small.partial-payment-value {
  color: var(--warn);
  font-weight: 800;
}

.value-stack small.settlement-count-value {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.value-stack small.provision-value {
  color: var(--info);
  font-weight: 800;
}

.row-actions {
  display: flex;
  gap: 6px;
  min-width: 150px;
}

.row-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--button-secondary-bg);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    transform var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

.row-actions button.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, var(--line));
}

.row-more-menu {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.row-more-menu summary {
  display: inline-grid;
  place-items: center;
  width: 32px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--button-secondary-bg);
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
  transition:
    transform var(--motion-fast) var(--motion-ease),
    border-color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    color var(--motion-fast) ease;
}

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

.row-more-menu > div {
  position: fixed;
  top: var(--row-menu-top, 0);
  left: var(--row-menu-left, 0);
  right: auto;
  z-index: 5600;
  width: var(--row-menu-width, 220px);
  min-width: 190px;
  display: grid;
  gap: 4px;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transform-origin: top right;
  animation: sfiFadeIn var(--motion-fast) ease both;
}

.row-more-menu > div button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  box-shadow: none;
  border-color: transparent;
  background: transparent;
}

.row-more-menu > div button:hover {
  border-color: var(--line);
  background: var(--button-secondary-bg);
}

.row-more-menu[open] summary {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--button-secondary-bg));
}

@container (max-width: 1260px) {
  .payable-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .payable-entry-table {
    display: block;
    min-width: 0;
  }

  .payable-entry-table thead {
    display: none;
  }

  .payable-entry-table tbody {
    display: grid;
    gap: 10px;
  }

  .payable-entry-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
  }

  .payable-entry-table td {
    display: grid;
    gap: 4px;
    min-width: 0;
    border: 0;
    padding: 0;
    text-align: left;
  }

  .payable-entry-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .payable-entry-table td:nth-child(1),
  .payable-entry-table td:nth-child(4),
  .payable-entry-table td:nth-child(10),
  .payable-entry-table td:nth-child(12) {
    grid-column: 1 / -1;
  }

  .payable-entry-table .select-cell {
    align-items: flex-start;
  }

  .payable-entry-table .value-stack {
    justify-items: start;
    text-align: left;
  }

  .payable-entry-table .row-actions {
    min-width: 0;
    justify-content: flex-start;
  }

  .payable-entry-table .row-more-menu > div {
    right: auto;
    left: var(--row-menu-left, 0);
  }
}

@container (max-width: 560px) {
  .payable-entry-table tr {
    grid-template-columns: 1fr;
  }

  .payable-entry-table td {
    grid-column: 1 / -1;
  }
}

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

.money.warn {
  color: var(--warn);
}

.money.negative {
  color: var(--danger);
}

.money.positive {
  color: var(--success);
}

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

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 2fr minmax(120px, auto);
  gap: 12px;
  align-items: center;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-alt);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.bar-fill.warn {
  background: var(--warn);
}

.bar-fill.success {
  background: var(--success);
}

.empty-state {
  padding: 32px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-subtle);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

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

.subsection-title h4 {
  margin: 0;
  font-size: 15px;
}

.subsection-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.migration-issues {
  margin: 18px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.migration-error-kpis {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.issue-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.issue-summary span {
  min-height: 28px;
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.source-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.source-details pre {
  max-height: 220px;
  min-width: 280px;
  margin: 10px 0 0;
  overflow: auto;
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  background: var(--button-secondary-bg);
  color: var(--muted);
  font-weight: 700;
}

.tabs button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.filter-sidebar .tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 10px;
}

.filter-sidebar .tabs button {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 30px;
  justify-content: center;
  border-radius: 8px;
  padding: 5px 7px;
  color: color-mix(in srgb, var(--muted) 88%, var(--ink));
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.filter-sidebar .tabs button.active {
  color: var(--button-fg);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 -2px 0 color-mix(in srgb, #fff 22%, transparent), 0 8px 18px color-mix(in srgb, var(--accent) 18%, transparent);
}

html[data-theme="light"] .filter-sidebar .tabs button {
  color: #3f3a35;
  background: #ffffff;
  border-color: #d8d3cf;
}

html[data-theme="light"] .filter-sidebar .tabs button:hover {
  color: #1f1c1a;
  background: #f8ecee;
  border-color: #c85f6a;
}

html[data-theme="light"] .filter-sidebar .tabs button.active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

html[data-theme="light"] .entry-kind-quick-switch > span,
html[data-theme="light"] .entry-kind-quick-switch button {
  color: #49443f;
}

html[data-theme="light"] .entry-kind-quick-switch button:hover {
  color: #1f1c1a;
  background: #f8ecee;
}

html[data-theme="light"] .entry-kind-quick-switch button.active {
  color: #ffffff;
  background: var(--accent);
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attachment-list a {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10050;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .toast {
  color: #111827;
  background: #f8fafc;
}

.file-progress {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 95;
  width: min(430px, calc(100vw - 36px));
}

.file-progress-card {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.file-progress-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.85s linear infinite;
}

.file-progress-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.file-progress-copy strong {
  color: var(--ink);
  font-size: 13px;
}

.file-progress-copy span {
  color: var(--muted);
  font-size: 12px;
}

.file-progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-alt);
}

.file-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 0.25s ease;
}

.file-progress-card b {
  min-width: 42px;
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

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

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

.modal-card {
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

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

.pagination-actions label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-actions select {
  width: auto;
  min-height: 34px;
}

@media (max-width: 1280px) {
  .app-topnav {
    padding-inline: 18px;
  }

  .page-header,
  .app-main {
    padding-left: 20px;
    padding-right: 20px;
  }

  .top-brand {
    min-width: 190px;
  }

  .list-layout {
    grid-template-columns: minmax(252px, 292px) minmax(0, 1fr);
    gap: 10px;
  }

  .filter-sidebar {
    top: 72px;
  }
}

@media (max-width: 1140px) {
  .list-layout {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    position: static;
    height: auto;
    max-height: none;
  }

  .filter-sidebar-body {
    max-height: 46vh;
  }

  .filter-sidebar.collapsed {
    width: auto;
    min-width: 0;
  }

  .filter-sidebar.collapsed .filter-sidebar-header div {
    display: block;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .main-nav {
    display: flex;
    flex-wrap: wrap;
  }

  .main-nav button,
  .main-nav a {
    width: auto;
  }

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

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

  .report-custom-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .page-header,
  .app-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .toolbar,
  .section-title,
  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .list-header-controls {
    width: 100%;
    min-width: 0;
    margin-left: 0;
  }

  .entry-kind-quick-switch {
    width: 100%;
    min-width: 0;
    align-items: stretch;
    flex-direction: column;
    border-radius: 8px;
  }

  .entry-kind-quick-switch > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .entry-kind-quick-switch button {
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
  }
}

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

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .app-main {
    padding: 16px;
  }

  .kpi-grid,
  .grid.two,
  .grid.three,
  .grid.four,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-4 {
    grid-column: span 1;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .selected-column-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Top navigation and launch drawer */
.app-shell {
  display: block;
  min-height: 100vh;
  background:
    linear-gradient(90deg, var(--app-grid-line) 1px, transparent 1px),
    linear-gradient(var(--app-grid-line) 1px, transparent 1px),
    var(--bg);
  background-attachment: fixed;
  background-size: 42px 42px, 42px 42px, auto;
}

.app-topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 12px clamp(14px, 1.8vw, 24px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.app-topnav::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-red), var(--accent), transparent 74%);
  opacity: 0.82;
  pointer-events: none;
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: clamp(170px, 16vw, 230px);
}

.brand-logo {
  width: auto;
  height: 48px;
  max-width: 150px;
  object-fit: contain;
  border-radius: 7px;
  background: transparent;
  padding: 0;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.brand-copy strong {
  display: block;
  color: var(--ink);
  line-height: 1.1;
}

.brand-copy small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex: 1 1 auto;
}

.nav-group {
  position: relative;
}

.nav-group-button {
  width: auto;
  justify-content: center;
  gap: 8px;
}

.nav-group-button::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.16s ease;
}

.nav-group.open .nav-group-button::after {
  transform: translateY(1px) rotate(225deg);
}

.nav-group.active > .nav-group-button,
.nav-group.open > .nav-group-button {
  color: var(--ink);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 60;
  display: none;
  min-width: 240px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nav-group.open .nav-dropdown {
  display: grid;
  gap: 4px;
  transform-origin: top left;
  animation: sfiFadeIn var(--motion-fast) ease both;
}

.main-nav .nav-dropdown button,
.main-nav .nav-dropdown a {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  color: var(--muted);
  background: transparent;
}

.main-nav .nav-dropdown button.active,
.main-nav .nav-dropdown a.active {
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

.mobile-menu-button {
  display: none;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--button-secondary-bg);
  color: var(--ink);
  font-weight: 800;
}

.topbar-actions {
  flex: 0 0 auto;
}

.theme-toggle {
  display: inline-grid;
  width: 38px;
  height: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  border-radius: 999px;
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-menu {
  position: relative;
  flex: 0 0 auto;
}

.account-menu-toggle {
  display: inline-grid;
  width: 38px;
  height: 38px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  background: var(--button-secondary-bg);
  border-color: var(--line);
  color: var(--ink);
}

.account-menu-toggle svg,
.account-menu-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-menu.open .account-menu-toggle,
.account-menu.active .account-menu-toggle {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}

.account-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  display: none;
  width: 250px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.account-menu.open .account-menu-dropdown {
  display: grid;
  gap: 4px;
  transform-origin: top right;
  animation: sfiFadeIn var(--motion-fast) ease both;
}

.account-menu-dropdown a,
.account-menu-dropdown button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

.account-menu-dropdown a:hover,
.account-menu-dropdown button:hover,
.account-menu-dropdown a.active {
  color: var(--ink);
  background: var(--accent-soft);
}

.account-menu-icon {
  display: inline-grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  color: var(--accent);
}

.account-menu-separator {
  height: 1px;
  margin: 4px 6px;
  background: var(--line);
}

.account-menu-dropdown .account-menu-logout,
.account-menu-dropdown .account-menu-logout .account-menu-icon {
  color: var(--danger);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px clamp(16px, 2vw, 30px) 0;
}

.page-header h2 {
  margin: 0;
}

.app-main {
  max-width: none;
  padding: 24px clamp(16px, 2vw, 30px) 48px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.42);
  animation: sfiFadeIn var(--motion-base) ease both;
}

.entry-drawer {
  display: flex;
  flex-direction: column;
  width: min(720px, 48vw);
  max-width: calc(100vw - 28px);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 45px rgba(15, 23, 42, 0.2);
  animation: drawerIn var(--motion-base) var(--motion-ease) both;
}

@keyframes drawerIn {
  from {
    opacity: 0;
    transform: translateX(34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.drawer-header h3 {
  margin: 0;
}

.drawer-header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.drawer-close {
  display: grid;
  width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--button-secondary-bg);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.party-edit-drawer {
  width: min(620px, 44vw);
}

.party-info-drawer {
  width: min(560px, 42vw);
}

.party-info-body {
  padding: 0;
}

.party-info-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  background: color-mix(in srgb, var(--surface-alt) 70%, var(--surface));
}

.party-info-summary > div {
  min-width: 0;
}

.party-info-source {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.party-info-summary h4 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.party-info-summary p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.party-info-notice {
  margin: 16px 22px 0;
  border-left: 3px solid var(--warn);
  padding: 10px 12px;
  background: color-mix(in srgb, var(--warn-soft) 72%, var(--surface));
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.party-info-section {
  padding: 20px 22px;
  border-top: 1px solid var(--line);
}

.party-info-section.payment {
  border-left: 3px solid var(--accent);
}

.party-info-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.party-info-section-title h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.party-info-section-title span {
  color: var(--muted);
  font-size: 11px;
}

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

.party-info-field {
  min-width: 0;
}

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

.party-info-field > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.party-info-field > div {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.party-info-field strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.party-info-field strong.is-empty {
  color: var(--muted);
  font-weight: 600;
}

.party-info-copy {
  display: inline-grid;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0;
  background: var(--button-secondary-bg);
  color: var(--muted);
}

.party-info-copy:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.party-info-copy svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.party-info-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 14px 22px;
  background: var(--surface);
}

.party-edit-current {
  display: grid;
  gap: 4px;
  margin: 18px 22px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent-soft) 42%, var(--surface));
}

.party-edit-current strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.party-edit-current span {
  color: var(--muted);
  font-size: 12px;
}

.drawer-form {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.payable-form-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 22px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.payable-form-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.payable-form-tabs button:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.payable-form-tabs button.active {
  color: #ffffff;
  background: var(--accent);
}

.payable-form-panel[hidden] {
  display: none;
}

.payable-basis-notice {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border-left: 3px solid var(--accent);
  background: var(--surface-subtle);
}

.payable-basis-notice strong {
  color: var(--ink);
  font-size: 12px;
}

.payable-basis-notice span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.payable-details-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.payable-details-heading > div {
  display: grid;
  gap: 3px;
}

.payable-details-heading span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.payable-details-heading strong {
  color: var(--ink);
  font-size: 13px;
}

.payable-details-heading b {
  color: var(--muted);
}

.drawer-form > .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 22px 8px;
}

.drawer-form .span-2,
.drawer-form .span-4 {
  grid-column: span 2;
}

.form-section-title {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

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

.drawer-form .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  justify-content: flex-end;
  margin-top: auto;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
}

.edit-entry-from-settlement-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.edit-entry-from-settlement-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
}

.field-with-action {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.field-with-action label {
  grid-column: 1;
}

.quick-add-button {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  align-self: end;
  justify-self: center;
  padding: 0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
}

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

.payable-party-value-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(120px, 170px);
  align-items: end;
  gap: 10px;
}

.payable-party-value-row .field-with-action {
  min-width: 0;
}

.supplier-payment-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: -4px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--ink);
}

.supplier-payment-notice strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.supplier-payment-notice strong::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.supplier-payment-notice span,
.supplier-payment-notice small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.supplier-payment-pix-choice {
  display: grid;
  flex: 1 1 280px;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.supplier-payment-pix-choice select {
  min-width: 0;
  height: 34px;
  padding: 5px 30px 5px 9px;
  font-size: 12px;
  text-transform: none;
}

.supplier-pix-editor {
  container-type: inline-size;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-subtle) 76%, transparent);
}

.supplier-pix-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.supplier-pix-editor-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.supplier-pix-editor-header strong {
  color: var(--ink);
  font-size: 12px;
}

.supplier-pix-editor-header span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.supplier-pix-editor-header button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 9px;
}

.supplier-pix-editor-header button svg,
.supplier-pix-remove svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.supplier-pix-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) auto 38px;
  align-items: end;
  gap: 8px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.supplier-pix-row label {
  min-width: 0;
}

.supplier-pix-primary-field {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.supplier-pix-primary-field input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.supplier-pix-remove {
  display: inline-grid;
  width: 38px;
  height: 40px;
  min-height: 40px;
  place-items: center;
  padding: 0;
  color: var(--danger);
}

@container (max-width: 620px) {
  .supplier-pix-editor-header {
    align-items: stretch;
    flex-direction: column;
  }

  .supplier-pix-editor-header button {
    justify-content: center;
    width: 100%;
  }

  .supplier-pix-row {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .supplier-pix-value-field,
  .supplier-pix-label-field {
    grid-column: 1 / -1;
  }

  .supplier-pix-primary-field {
    grid-column: 1;
  }

  .supplier-pix-remove {
    grid-column: 2;
  }
}

.compact-money-field {
  min-width: 0;
  width: min(170px, 100%);
}

.recurrence-fields {
  transition: opacity 0.14s ease;
}

.series-update-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.series-update-panel {
  display: grid;
  gap: 12px;
  padding: 0 13px 13px;
}

.series-update-notice {
  display: grid;
  gap: 4px;
  border: 1px solid color-mix(in srgb, var(--info) 30%, var(--line));
  border-radius: 8px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--info-soft) 58%, var(--surface));
}

.series-update-notice strong {
  color: var(--ink);
  font-size: 13px;
}

.series-update-notice span,
.series-update-panel .muted {
  font-size: 12px;
  line-height: 1.4;
}

.series-update-toggle {
  width: fit-content;
  min-height: 32px;
  padding: 6px 0;
}

.series-update-scope {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.series-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface);
}

.series-field-grid .inline-check,
.series-update-scope .inline-check {
  min-height: 30px;
  padding: 4px 0;
  font-size: 12px;
}

.employee-discount-drawer,
.cash-drawer {
  width: min(680px, 46vw);
}

.cash-drawer .panel {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.cash-drawer .panel + .panel {
  border-top: 1px solid var(--line);
}

.cash-drawer .drawer-form > .form-grid,
.employee-discount-drawer .drawer-form > .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.transfer-kind-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.transfer-kind-preview p {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.cash-direction-tabs {
  margin-bottom: 12px;
}

.cash-statement-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.cash-statement-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cash-statement-summary strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cash-statement-summary .cash-clear-ok-button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
}

.cash-selection-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-subtle) 82%, var(--accent) 12%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cash-selection-summary strong {
  color: var(--ink);
}

.select-col {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  text-align: center !important;
}

.select-col input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.cash-statement-table {
  min-width: 980px;
}

.cash-statement-table th:nth-child(7),
.cash-statement-table td:nth-child(7) {
  text-align: right;
}

.cash-statement-table th:nth-child(8),
.cash-statement-table td:nth-child(8) {
  width: 84px;
  text-align: center;
}

.cash-statement-source-cell .cash-source-indicator {
  margin-inline: auto;
}

.cash-statement-table th,
.cash-statement-table td {
  vertical-align: middle;
}

.cash-statement-balance-row,
.cash-statement-day-balance {
  background: color-mix(in srgb, var(--surface-subtle) 86%, var(--accent) 14%);
  font-weight: 900;
}

.cash-statement-balance-row td,
.cash-statement-day-balance td {
  border-top: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
}

.cash-statement-day-balance td:nth-child(3),
.cash-statement-balance-row td:nth-child(4) {
  text-align: right;
  color: var(--ink);
}

.cash-statement-opening {
  background: color-mix(in srgb, var(--surface-subtle) 72%, var(--info) 10%);
}

.cash-statement-final {
  background: color-mix(in srgb, var(--surface-subtle) 70%, var(--accent) 18%);
}

.cash-statement-ok-day td {
  background: color-mix(in srgb, var(--success-soft) 46%, transparent);
}

.cash-statement-day-balance.day-ok {
  background: color-mix(in srgb, var(--success-soft) 72%, var(--accent) 16%);
}

.cash-day-ok-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 26px;
  min-height: 26px;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, var(--accent) 24%);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.cash-day-ok-button:hover {
  border-color: var(--success);
  color: var(--success);
}

.cash-day-ok-button.active {
  border-color: color-mix(in srgb, var(--success) 72%, var(--line));
  background: var(--success-soft);
  color: var(--success);
}

.cash-period-field .period-filter {
  display: block;
}

.compact-select-field {
  width: min(170px, 100%);
}

.invoice-number-group {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.invoice-number-group > .quick-add-button {
  grid-column: 3;
  grid-row: 1;
}

.invoice-number-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.extra-invoice-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.extra-invoice-row .mini-button {
  width: 40px;
  height: 40px;
  min-height: 40px;
  justify-self: stretch;
  padding: 0;
  font-size: 18px;
}

.fiscal-composition {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.contract-composition {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.payable-simple-classification {
  display: grid;
  gap: 12px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.payable-simple-classification-heading .form-section-title {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 14px;
}

.payable-simple-classification-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.payable-simple-classification-fields {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.payable-simple-details {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--surface-subtle);
}

.payable-simple-details strong {
  color: var(--ink);
  font-size: 13px;
}

.payable-simple-details span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.contract-composition-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.contract-composition-heading .form-section-title {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 14px;
}

.contract-composition-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.contract-composition .allocation-panel {
  padding: 0;
}

.fiscal-composition[hidden],
.contract-composition[hidden],
.payable-simple-classification[hidden],
.payable-simple-details[hidden] {
  display: none;
}

.fiscal-composition-heading,
.fiscal-document-header,
.fiscal-classification-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fiscal-composition-heading {
  align-items: flex-start;
  flex-direction: column;
}

.fiscal-composition-heading .form-section-title {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 14px;
}

.fiscal-composition-heading p,
.fiscal-classification-heading span {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.fiscal-composition-actions,
.fiscal-document-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.fiscal-composition-actions {
  width: 100%;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.fiscal-composition-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-subtle);
}

.fiscal-composition-summary > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.fiscal-composition-summary > span + span {
  border-left: 1px solid var(--line);
}

.fiscal-composition-summary strong {
  color: var(--ink);
}

.fiscal-composition-summary .complete strong,
.fiscal-document-balance.complete {
  color: var(--success);
}

.fiscal-composition-summary .mismatch strong,
.fiscal-document-balance.mismatch {
  color: var(--danger);
}

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

.fiscal-document-item {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.fiscal-document-header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.fiscal-document-header > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.fiscal-document-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.fiscal-document-balance {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.fiscal-document-header .mini-button,
.fiscal-allocation-row .mini-button {
  width: 38px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  font-size: 18px;
}

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

.fiscal-classification-heading {
  align-items: flex-end;
}

.fiscal-classification-heading strong {
  font-size: 12px;
}

.compact-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

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

.fiscal-allocation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(120px, 0.65fr) 38px;
  align-items: end;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.fiscal-document-item.single-fiscal-document .fiscal-document-amount-field,
.fiscal-document-item.single-fiscal-allocation .fiscal-allocation-amount-field {
  display: none;
}

.fiscal-document-item.single-fiscal-allocation .fiscal-allocation-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
}

.fiscal-allocation-row .mini-button {
  justify-self: end;
}

.fiscal-composition-empty {
  display: grid;
  gap: 3px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
}

.fiscal-composition-empty strong {
  color: var(--ink);
  font-size: 12px;
}

.fiscal-composition-empty span {
  font-size: 11px;
}

.fiscal-composition-empty[hidden] {
  display: none;
}

.allocation-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.allocation-panel {
  display: grid;
  gap: 10px;
  padding: 0 13px 13px;
}

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

.allocation-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(150px, 1.25fr) minmax(110px, 0.75fr) 72px minmax(110px, 0.85fr) auto;
  align-items: end;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

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

.drawer-form .allocation-row .mini-button {
  justify-self: end;
}

.allocation-row .mini-button {
  width: 38px;
  height: 40px;
  min-height: 40px;
  justify-self: stretch;
  padding: 0;
  font-size: 18px;
}

.allocation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.rateio-lock-note {
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  padding: 9px 11px;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-disabled {
  opacity: 0.62;
}

.field-disabled select {
  cursor: not-allowed;
}

.allocation-summary-card {
  grid-column: span 2;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-subtle);
}

.allocation-summary-card strong {
  display: block;
  margin-bottom: 8px;
}

.allocation-summary-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.drawer-form .compact-panel {
  align-items: flex-start;
}

.settlement-drawer {
  width: min(680px, 46vw);
}

.bulk-correction-drawer {
  width: min(1040px, 86vw);
  container-type: inline-size;
}

.bulk-correction-form-grid {
  gap: 16px;
}

.bulk-correction-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--line);
  background: var(--surface-subtle);
}

.bulk-correction-summary > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
}

.bulk-correction-summary > div + div {
  border-left: 1px solid var(--line);
}

.bulk-correction-summary strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 15px;
}

.bulk-correction-summary span,
.bulk-correction-entry-cell span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.bulk-correction-mode {
  display: inline-flex;
  justify-self: start;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: var(--surface-subtle);
}

.bulk-correction-mode button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  padding: 7px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.bulk-correction-mode button.active {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-soft);
}

.bulk-correction-panel[hidden] {
  display: none;
}

fieldset.bulk-correction-panel {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.bulk-correction-panel > .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bulk-correction-panel .span-2,
.bulk-correction-panel .span-4 {
  grid-column: span 1;
}

.bulk-correction-panel .span-4 {
  grid-column: 1 / -1;
}

.bulk-correction-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.bulk-correction-table {
  margin-top: 12px;
}

.bulk-correction-table table {
  min-width: 1080px;
}

.bulk-correction-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-alt);
}

.bulk-correction-table td {
  vertical-align: middle;
}

.bulk-correction-table select,
.bulk-correction-table input[type="date"] {
  width: 100%;
  min-width: 145px;
  min-height: 36px;
  padding: 7px 9px;
  font-size: 12px;
}

.bulk-correction-table td:nth-child(2) select,
.bulk-correction-table td:nth-child(3) select {
  min-width: 190px;
}

.bulk-correction-entry-cell {
  min-width: 210px;
}

.bulk-correction-entry-cell strong,
.bulk-correction-entry-cell span {
  display: block;
}

.bulk-correction-entry-cell strong {
  margin-bottom: 4px;
  color: var(--ink);
}

.bulk-correction-no-settlement {
  display: inline-block;
  min-width: 100px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.bulk-correction-summary strong small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.correction-section-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-strong);
}

.correction-section-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.correction-section-heading > span,
.correction-caption,
.correction-field-state,
.correction-entry-identity > span,
.correction-entry-meta > span:last-child {
  font-size: 11px;
  color: var(--muted);
}

.correction-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1.2fr);
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.correction-current,
.correction-next {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.correction-current-value {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
}

.correction-current-value > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.correction-current-value > small {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--muted);
}

.correction-caption {
  font-weight: 700;
}

.correction-more-values summary {
  cursor: pointer;
  color: var(--info);
  font-size: 11px;
}

.correction-more-values .correction-current-value {
  margin-top: 6px;
}

.correction-arrow {
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-height: 28px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.correction-next > label,
.correction-next input,
.correction-next select,
.correction-next .single-category-tree-select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.correction-field.has-changes > .correction-arrow,
.correction-field.has-changes .correction-field-state,
.correction-submit-status.has-changes {
  color: var(--success);
  font-weight: 700;
}

.correction-field.has-changes .correction-next input:not([type="hidden"]),
.correction-field.has-changes .correction-next select,
.correction-field.has-changes .correction-next [data-single-category-tree] > summary {
  border-color: color-mix(in srgb, var(--success) 65%, var(--line));
}

.correction-inline-note,
.correction-validation {
  margin: 10px 0;
  border-left: 3px solid var(--info);
  padding: 8px 12px;
  color: var(--info);
  background: var(--info-soft);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.correction-validation {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.correction-individual-entry,
.correction-preview-entry {
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.correction-individual-entry > summary,
.correction-preview-entry > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  padding: 14px 2px;
  list-style: none;
}

.correction-individual-entry > summary::-webkit-details-marker,
.correction-preview-entry > summary::-webkit-details-marker {
  display: none;
}

.correction-individual-entry > summary::after,
.correction-preview-entry > summary::after {
  content: "+";
  color: var(--muted);
  text-align: center;
  font-size: 18px;
}

.correction-individual-entry[open] > summary::after,
.correction-preview-entry[open] > summary::after {
  content: "\2212";
}

.correction-entry-identity,
.correction-entry-meta {
  display: grid;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.correction-entry-identity strong,
.correction-entry-meta strong {
  font-size: 12px;
  color: var(--ink);
}

.correction-entry-meta {
  justify-items: end;
}

.correction-group-label {
  padding-top: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.correction-review {
  margin-top: 6px;
  min-width: 0;
}

.correction-preview-badge {
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 11px;
}

.correction-preview-entry.has-changes .correction-preview-badge {
  background: var(--success-soft);
  color: var(--success);
}

.correction-preview-content {
  padding-bottom: 12px;
}

.correction-preview-context,
.correction-preview-unchanged {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--muted);
}

.correction-diff-head,
.correction-diff-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.7fr) minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.correction-diff-head {
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.correction-diff-before {
  color: var(--muted);
}

.correction-diff-after {
  color: var(--success);
  font-weight: 700;
}

.correction-form-actions {
  flex-wrap: wrap;
}

.correction-submit-status {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}

@container (max-width: 620px) {
  .correction-field {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
  }

  .correction-current {
    grid-column: 1 / -1;
  }

  .correction-field > .correction-arrow {
    width: 22px;
    transform: rotate(90deg);
  }

  .correction-diff-row {
    grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
    gap: 8px;
  }

  .correction-diff-row > strong {
    grid-column: 1 / -1;
  }

  .correction-diff-head {
    display: none;
  }

  .correction-individual-entry > summary,
  .correction-preview-entry > summary {
    gap: 8px;
  }

  .correction-form-actions > .correction-submit-status {
    flex-basis: 100%;
  }
}

.history-drawer {
  width: min(760px, 54vw);
}

.history-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(3, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.history-summary-item {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.history-summary-item.span-2 {
  grid-column: span 2;
}

.history-summary-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.history-summary-item strong {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  background: var(--field-bg);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.receivable-history-table table {
  min-width: 900px;
}

.receivable-history-table tfoot th {
  background: color-mix(in srgb, var(--surface-alt) 92%, var(--accent) 8%);
  color: var(--ink);
  font-weight: 900;
}

.settlement-history-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.settlement-history-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 48px 12px 12px;
  background: color-mix(in srgb, var(--surface-subtle) 86%, var(--surface));
}

.settlement-history-main {
  display: grid;
  grid-template-columns: minmax(92px, 0.75fr) minmax(112px, 0.85fr) minmax(0, 1.4fr);
  gap: 8px;
  min-width: 0;
}

.settlement-history-details {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(120px, 0.75fr) minmax(92px, 0.55fr);
  gap: 8px;
  min-width: 0;
}

.settlement-history-card div {
  min-width: 0;
}

.settlement-history-card span:not(.status-pill),
.settlement-history-totals > strong {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.settlement-history-card strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.settlement-history-main > div,
.settlement-history-details > div {
  display: grid;
  gap: 4px;
  min-height: 44px;
  align-content: center;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  padding: 8px;
  background: color-mix(in srgb, var(--field-bg) 80%, transparent);
}

.settlement-history-main > div:nth-child(2) strong {
  color: var(--accent-strong);
  font-variant-numeric: tabular-nums;
}

.settlement-history-adjustments,
.settlement-history-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.settlement-history-adjustments span,
.settlement-history-totals span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.settlement-history-adjustments b,
.settlement-history-adjustments strong,
.settlement-history-totals b {
  color: var(--ink);
  font-weight: 900;
}

.settlement-history-totals {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.settlement-cancel-button {
  position: absolute;
  top: 10px;
  right: 10px;
}

.icon-danger-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--danger) 36%, var(--line));
  border-radius: 6px;
  padding: 0;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.icon-danger-button:hover {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
}

.settlement-info-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-subtle) 92%, var(--accent) 8%), var(--surface-subtle));
}

.settlement-info-card div {
  min-width: 0;
}

.settlement-info-card > div {
  display: grid;
  align-content: center;
  gap: 4px;
}

.settlement-info-card span:not(.status-pill) {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.settlement-info-card strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.settlement-info-main {
  grid-column: span 2;
  min-height: 70px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.settlement-info-main strong {
  font-size: 15px;
  line-height: 1.35;
}

.settlement-info-value,
.settlement-info-status,
.settlement-info-item {
  min-height: 58px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}

.settlement-info-value strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.settlement-info-balance {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.settlement-info-status .status-pill {
  width: fit-content;
  max-width: 100%;
  min-width: 112px;
  justify-content: center;
}

.settlement-info-audit .audit-line {
  margin-top: 0;
}

.audit-line {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0;
  text-transform: none;
}

.audit-line strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.audit-line small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.record-audit-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: color-mix(in srgb, var(--surface-subtle) 86%, var(--surface));
}

.record-audit-card div {
  min-width: 0;
}

.record-audit-card > div > span:first-child {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.audit-kpis {
  margin-bottom: 14px;
}

.audit-table-wrap {
  border-radius: 8px;
}

.audit-table {
  min-width: 1180px;
}

.audit-table th,
.audit-table td {
  vertical-align: top;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
  width: 150px;
}

.audit-table th:nth-child(2),
.audit-table td:nth-child(2) {
  width: 110px;
}

.audit-table th:nth-child(3),
.audit-table td:nth-child(3) {
  width: 155px;
}

.audit-table th:nth-child(4),
.audit-table td:nth-child(4) {
  width: 165px;
}

.audit-table th:nth-child(5),
.audit-table td:nth-child(5) {
  width: 300px;
}

.audit-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.audit-record {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.audit-change-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.audit-change-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 7px;
  background: color-mix(in srgb, var(--surface-subtle) 80%, transparent);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.audit-change-item span {
  color: var(--muted);
  font-weight: 900;
}

.audit-change-item strong {
  color: var(--ink);
  font-weight: 900;
}

.audit-change-item em {
  color: var(--accent);
  font-style: normal;
  font-weight: 900;
}

.audit-change-list small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.audit-change-reason {
  width: fit-content;
  max-width: 100%;
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--warn-soft);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
}

.settlement-adjustments {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: color-mix(in srgb, var(--surface-subtle) 72%, var(--surface));
}

.settlement-adjustments label {
  min-width: 0;
  gap: 5px;
  font-size: 11px;
}

.settlement-adjustments input {
  height: 36px;
  min-height: 36px;
  padding-inline: 8px;
  font-size: 12px;
}

.settlement-calculation {
  display: grid;
  gap: 4px;
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 12px;
}

.settlement-calculation span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.settlement-calculation strong {
  color: var(--ink);
}

.settlement-calculation small {
  color: var(--muted);
}

.inventory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.inventory-tabs button {
  min-height: 34px;
  padding: 6px 11px;
  white-space: nowrap;
}

.inventory-kpis {
  margin-bottom: 14px;
}

.inventory-form-panel {
  border-left: 3px solid var(--accent);
}

.inventory-center-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.inventory-center-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
}

.inventory-center-row:not(:nth-child(3n)) {
  border-right: 1px solid var(--line);
}

.inventory-center-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.inventory-center-row span {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.inventory-receipt-header {
  margin-bottom: 12px;
}

.inventory-line-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.inventory-transaction-line {
  display: grid;
  grid-template-columns: minmax(190px, 1.6fr) minmax(190px, 1.4fr) minmax(92px, .65fr) minmax(120px, .8fr) 34px;
  gap: 8px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: color-mix(in srgb, var(--surface-subtle) 74%, var(--surface));
}

.inventory-delivery-line {
  grid-template-columns: minmax(240px, 2fr) minmax(100px, .6fr) 34px;
}

.inventory-transaction-line label {
  min-width: 0;
}

.inventory-remove-line {
  width: 34px;
  min-width: 34px;
  height: 38px;
  margin: 0;
  color: var(--danger);
  font-size: 18px;
}

.inventory-line-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.inventory-line-actions span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-inline-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
  border-block: 1px solid var(--line);
  padding-block: 10px;
}

.inventory-inline-filters button {
  min-height: 40px;
}

.inventory-due-table td:nth-child(5),
.inventory-due-table td:nth-child(6),
.inventory-due-table td:nth-child(7) {
  text-align: center;
}

@media (max-width: 1180px) {
  .app-topnav {
    flex-wrap: wrap;
    gap: 10px;
  }

  .top-brand {
    min-width: 0;
    margin-right: auto;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
  }

  .top-nav {
    order: 3;
    display: none;
    width: 100%;
    flex-basis: 100%;
    align-items: stretch;
  }

  .top-nav.mobile-open {
    display: grid;
    gap: 8px;
  }

  .nav-group {
    width: 100%;
  }

  .nav-group-button {
    width: 100%;
    justify-content: space-between;
  }

  .nav-dropdown {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }

  .entry-drawer {
    width: min(760px, 86vw);
  }

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

  .history-summary-item.span-2 {
    grid-column: auto;
  }

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

  .fiscal-document-fields,
  .fiscal-allocation-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fiscal-allocation-row .mini-button {
    justify-self: end;
  }

  .record-audit-card {
    grid-template-columns: 1fr;
  }

  .settlement-adjustments {
    grid-template-columns: repeat(2, minmax(92px, 1fr));
  }

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

  .inventory-center-row:not(:nth-child(3n)) {
    border-right: 0;
  }

  .inventory-center-row:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

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

  .inventory-remove-line {
    justify-self: end;
  }

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

@media (max-width: 720px) {
  .app-topnav {
    padding: 10px 14px;
  }

  .brand-logo {
    height: 34px;
    max-width: 96px;
  }

  .brand-copy small {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
  }

  .user-pill {
    display: none;
  }

  .page-header,
  .app-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .entry-drawer {
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
  }

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

  .bulk-correction-summary > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .bulk-correction-mode {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bulk-correction-mode button {
    padding-inline: 8px;
  }

  .bulk-correction-panel > .form-grid {
    grid-template-columns: 1fr;
  }

  .bulk-correction-panel .span-2,
  .bulk-correction-panel .span-4 {
    grid-column: 1;
  }

  .entry-drawer.missing-data-review-drawer {
    width: 100vw;
    max-width: 100vw;
  }

  .entry-drawer .drawer-body,
  .drawer-form,
  .drawer-form > .form-grid {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .drawer-form input[type="file"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .missing-data-review-body {
    padding: 16px;
  }

  .missing-data-review-stats > div {
    padding: 12px 9px;
  }

  .missing-data-review-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .missing-data-edit-button {
    width: 100%;
  }

  .bank-limit-editor-header {
    display: grid;
  }

  .bank-limit-editor-header > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .bank-limit-editor-header button {
    width: 100%;
    justify-content: center;
  }

  .bank-limit-rule-line {
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: end;
  }

  .bank-limit-rule-line label {
    grid-column: 1 / -1;
  }

  .bank-limit-rule-line .bank-limit-remove-rule {
    grid-column: 2;
  }

  .bank-limit-rule-usage {
    grid-column: 1 / -1;
    align-items: flex-start;
    flex-direction: column;
  }

  .bank-limit-projection-row {
    grid-template-columns: 1fr;
  }

  .bank-limit-projection-values {
    text-align: left;
  }

  .bank-limit-progress {
    grid-column: 1;
  }

  .party-info-summary,
  .party-info-section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .party-info-notice {
    margin-left: 16px;
    margin-right: 16px;
  }

  .party-info-grid {
    grid-template-columns: 1fr;
  }

  .party-info-field.wide {
    grid-column: auto;
  }

  .party-info-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .drawer-form > .form-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .payable-form-tabs {
    margin: 12px 16px 0;
  }

  .payable-details-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .payable-details-heading button {
    width: 100%;
    justify-content: center;
  }

  .drawer-form .span-2,
  .drawer-form .span-4,
  .field-with-action {
    grid-column: span 1;
  }

  .field-with-action {
    grid-template-columns: 1fr auto;
  }

  .supplier-pix-editor-header {
    align-items: stretch;
    flex-direction: column;
  }

  .supplier-pix-editor-header button {
    justify-content: center;
    width: 100%;
  }

  .supplier-pix-row {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .supplier-pix-value-field,
  .supplier-pix-label-field {
    grid-column: 1 / -1;
  }

  .supplier-pix-primary-field {
    grid-column: 1;
  }

  .supplier-pix-remove {
    grid-column: 2;
  }

  .payable-party-value-row {
    grid-template-columns: 1fr;
  }

  .fiscal-composition-heading,
  .fiscal-document-header,
  .fiscal-classification-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .fiscal-composition-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .fiscal-composition-actions button,
  .fiscal-classification-heading button {
    width: 100%;
    justify-content: center;
  }

  .fiscal-composition-summary,
  .fiscal-document-fields,
  .fiscal-allocation-row {
    grid-template-columns: 1fr;
  }

  .fiscal-document-item.single-fiscal-allocation .fiscal-allocation-row {
    grid-template-columns: 1fr;
  }

  .fiscal-composition-summary > span + span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .fiscal-document-header-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .settlement-info-main {
    grid-column: 1 / -1;
  }

  .settlement-history-main,
  .settlement-history-details {
    grid-template-columns: 1fr;
  }

  .allocation-row {
    grid-template-columns: 1fr;
  }

  .drawer-form .allocation-row {
    grid-template-columns: 1fr;
  }

  .allocation-summary-card {
    grid-column: span 1;
  }

  .settlement-calculation span {
    display: block;
  }

  .inventory-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .inventory-center-summary,
  .inventory-transaction-line,
  .inventory-delivery-line,
  .inventory-inline-filters {
    grid-template-columns: 1fr;
  }

  .inventory-center-row,
  .inventory-center-row:nth-child(odd) {
    border-right: 0;
  }

  .inventory-remove-line {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

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

.balance-sheet-controls,
.balance-sheet-panel {
  margin-top: 16px;
}

.balance-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.45fr);
  gap: 22px;
  align-items: end;
}

.balance-control-grid form {
  display: grid;
  grid-template-columns: repeat(2, minmax(155px, 0.5fr)) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.balance-control-grid form > button {
  min-height: 40px;
}

.balance-all-period-button {
  grid-column: 1 / -1;
  justify-self: start;
  min-height: 34px !important;
}

.balance-view-choice {
  display: grid;
  gap: 7px;
}

.balance-view-choice small {
  color: var(--muted);
}

.balance-view-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.balance-view-tabs button {
  justify-content: center;
}

.balance-table-scroll {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.balance-sheet-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.balance-sheet-table th,
.balance-sheet-table td {
  height: 38px;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.balance-sheet-table tr:last-child th,
.balance-sheet-table tr:last-child td {
  border-bottom: 0;
}

.balance-sheet-table th:last-child,
.balance-sheet-table td:last-child {
  border-right: 0;
}

.balance-sheet-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  min-width: 138px;
  background: var(--table-head);
  color: var(--muted);
  text-align: right;
  font-size: 11px;
  line-height: 1.2;
  white-space: normal;
}

.balance-sheet-table thead th:first-child,
.balance-sheet-table tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 310px;
  min-width: 310px;
  max-width: 310px;
  text-align: left;
}

.balance-sheet-table thead th:first-child {
  z-index: 4;
}

.balance-sheet-table tbody th {
  background: var(--surface);
  font-weight: 650;
}

.balance-value {
  min-width: 138px;
  background: var(--surface);
  text-align: right;
  white-space: nowrap;
}

.balance-total {
  background: var(--surface-subtle);
  font-weight: 800;
}

.balance-section-row th,
.balance-section-row td,
.balance-result-heading th {
  background: var(--table-head);
  font-weight: 800;
}

.balance-section-row.positive th {
  box-shadow: inset 3px 0 0 var(--success);
}

.balance-section-row.negative th {
  box-shadow: inset 3px 0 0 var(--danger);
}

.balance-section-row .positive,
.balance-result-row .positive {
  color: var(--success);
}

.balance-section-row .negative,
.balance-result-row .negative {
  color: var(--danger);
}

.balance-detail-row:hover th,
.balance-detail-row:hover td {
  background: var(--table-row-hover);
}

.balance-detail-row.balance-level-1 th {
  padding-left: 14px;
}

.balance-detail-row.balance-level-2 th {
  padding-left: 32px;
  color: var(--muted);
}

.balance-detail-row.balance-level-3 th {
  padding-left: 52px;
  color: var(--muted);
  font-weight: 550;
}

.balance-expand-button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  width: 100%;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font-weight: inherit;
}

.balance-expand-icon {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.balance-expand-label,
.balance-leaf-label {
  min-width: 0;
  max-width: 100%;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.balance-expand-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.balance-leaf-label {
  display: block;
  padding-left: 18px;
}

.balance-empty-row td {
  background: var(--surface-subtle);
  color: var(--muted);
  font-style: italic;
}

.balance-result-heading th {
  position: static !important;
  height: 34px;
  color: var(--text);
}

.balance-result-row th,
.balance-result-row td {
  background: var(--surface-subtle);
  font-weight: 750;
}

.balance-result-row:last-child th,
.balance-result-row:last-child td {
  border-top: 2px solid var(--line-strong);
  font-size: 13px;
  font-weight: 850;
}

@media (max-width: 1100px) {
  .balance-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .balance-control-grid {
    grid-template-columns: 1fr;
  }
}

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

  .balance-control-grid form {
    grid-template-columns: 1fr;
  }

  .balance-control-grid form > button {
    width: 100%;
  }

  .balance-sheet-table thead th:first-child,
  .balance-sheet-table tbody th {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
  }
}

/* Customização das colunas dos lançamentos */
.entry-column-drawer {
  width: min(470px, 42vw);
  min-width: 380px;
}

.entry-column-drawer .drawer-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 20px 20px;
}

.entry-column-list {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-alt) 54%, transparent);
}

.entry-column-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.entry-column-item.is-required {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.entry-column-item.is-dragging {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent);
}

.entry-column-item.is-drop-target {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow: inset 0 2px 0 var(--accent);
}

.entry-column-toggle {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  cursor: pointer;
}

.entry-column-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.entry-column-toggle span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-alt);
  transition: border-color var(--motion-fast) ease, background var(--motion-fast) ease;
}

.entry-column-toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform var(--motion-fast) ease, background var(--motion-fast) ease;
}

.entry-column-toggle input:checked + span {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 28%, var(--surface));
}

.entry-column-toggle input:checked + span::after {
  background: var(--accent);
  transform: translateX(16px);
}

.entry-column-toggle input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.entry-column-toggle input:disabled + span {
  cursor: not-allowed;
  opacity: 0.66;
}

.entry-column-footer-actions {
  position: sticky;
  bottom: -20px;
  z-index: 2;
  justify-content: flex-end;
  margin: auto -20px -20px;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

table.finance-entry-table[data-customizable-columns] .entry-column-select {
  box-sizing: border-box;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  padding-inline: 10px;
  text-align: center;
}

table.finance-entry-table[data-customizable-columns] th.entry-column-select .select-cell,
table.finance-entry-table[data-customizable-columns] td.entry-column-select .select-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  margin: 0;
  text-align: center;
}

table.finance-entry-table[data-customizable-columns] thead .entry-column-select .select-cell input,
table.finance-entry-table[data-customizable-columns] tbody .entry-column-select .select-cell input {
  position: static;
  left: auto;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
}

table.finance-entry-table[data-customizable-columns] .entry-column-actions {
  width: 128px;
  min-width: 112px;
  overflow: visible;
  text-align: center;
}

table.finance-entry-table[data-customizable-columns] [data-column="party"] { width: 12%; }
table.finance-entry-table[data-customizable-columns] [data-column="document"] { width: 7%; }
table.finance-entry-table[data-customizable-columns] [data-column="invoice"] { width: 6%; }
table.finance-entry-table[data-customizable-columns] [data-column="fiscal"] { width: 11%; }
table.finance-entry-table[data-customizable-columns] [data-column="history"] { width: 14%; }
table.finance-entry-table[data-customizable-columns] [data-column="type"] { width: 6%; }
table.finance-entry-table[data-customizable-columns] [data-column="category"] { width: 9%; }
table.finance-entry-table[data-customizable-columns] [data-column="costCenter"] { width: 7%; }
table.finance-entry-table[data-customizable-columns] [data-column="bank"] { width: 7%; }
table.finance-entry-table[data-customizable-columns] [data-column="installment"] { width: 5%; }
table.finance-entry-table[data-customizable-columns] [data-column="dueDate"],
table.finance-entry-table[data-customizable-columns] [data-column="settlementDate"] { width: 7%; }
table.finance-entry-table[data-customizable-columns] [data-column="value"] { width: 8%; }
table.finance-entry-table[data-customizable-columns] [data-column="status"] { width: 7%; }

table.payable-entry-table.finance-entry-table[data-customizable-columns] th[data-column],
table.payable-entry-table.finance-entry-table[data-customizable-columns] td[data-column],
table.receivables-entry-table.finance-entry-table[data-customizable-columns] th[data-column],
table.receivables-entry-table.finance-entry-table[data-customizable-columns] td[data-column] {
  text-align: left;
}

table.payable-entry-table.finance-entry-table[data-customizable-columns] th.entry-column-party {
  padding-left: 39px;
}

table.receivables-entry-table.finance-entry-table[data-customizable-columns] th.entry-column-party {
  padding-left: 38px;
}

table.finance-entry-table[data-customizable-columns] th[data-column] .table-sort-button {
  justify-content: flex-start;
}

table.finance-entry-table[data-customizable-columns] .entry-column-status .status-pill,
table.finance-entry-table[data-customizable-columns] .entry-column-value .value-stack,
table.finance-entry-table[data-customizable-columns] .entry-column-value .receivable-value-stack {
  justify-content: flex-start;
  justify-items: start;
  margin-inline: 0;
  text-align: left;
}

table.finance-entry-table[data-customizable-columns] .entry-column-fiscal .receivable-fiscal-card {
  margin-inline: 0;
}

table.finance-entry-table.entry-table-flexible[data-customizable-columns] {
  table-layout: auto;
}

table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column] {
  width: auto;
}

table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="party"] {
  min-width: 180px;
}

table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="history"] {
  min-width: 220px;
}

table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="fiscal"] {
  min-width: 118px;
}

table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="category"] {
  min-width: 120px;
}

table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="bank"] {
  min-width: 108px;
}

table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="document"],
table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="invoice"],
table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="type"],
table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="costCenter"],
table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="installment"],
table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="dueDate"],
table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="settlementDate"],
table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="value"],
table.finance-entry-table.entry-table-flexible[data-customizable-columns] [data-column="status"] {
  width: 1%;
  white-space: nowrap;
}

table.finance-entry-table.entry-table-flexible[data-customizable-columns] .entry-column-actions {
  width: 82px;
  min-width: 82px;
}

@container (max-width: 1260px) {
  .payable-entry-table[data-customizable-columns] td[data-column] {
    grid-column: auto;
    text-align: left;
  }

  .payable-entry-table[data-customizable-columns] td.entry-column-select,
  .payable-entry-table[data-customizable-columns] td.entry-column-party,
  .payable-entry-table[data-customizable-columns] td.entry-column-history,
  .payable-entry-table[data-customizable-columns] td.entry-column-actions {
    grid-column: 1 / -1;
  }

  .payable-entry-table[data-customizable-columns] .entry-column-value .value-stack {
    justify-items: start;
    margin-inline: 0;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .entry-column-drawer {
    width: 100vw;
    min-width: 0;
    max-width: 100vw;
  }

  .entry-column-footer-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .entry-column-footer-actions button {
    width: 100%;
  }
}
