:root {
  --ink: #1e2031;
  --muted: #686b78;
  --line: #dfe2e8;
  --panel: #ffffff;
  --bg: #f4f6f8;
  --orange: #ee7d22;
  --green: #19735b;
  --red: #a73535;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

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

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  cursor: pointer;
}

button.secondary {
  background: #576071;
}

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

button:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.35);
}

.layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 252px 1fr;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.brand-logo {
  width: 190px;
  height: auto;
  object-fit: contain;
}

nav {
  display: grid;
  gap: 8px;
}

.sidebar form {
  margin-top: auto;
}

.nav-item,
.logout {
  width: 100%;
  color: var(--ink);
  background: transparent;
  text-align: left;
  border: 1px solid transparent;
}

.nav-item.active {
  color: #fff;
  background: var(--ink);
}

.nav-item:hover,
.logout:hover {
  border-color: var(--line);
}

.workspace {
  min-width: 0;
  padding: 22px;
}

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

.topbar {
  margin-bottom: 20px;
}

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

h1 {
  margin-bottom: 4px;
  font-size: 26px;
}

h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

h3 {
  font-size: 17px;
}

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

.status-pill {
  max-width: min(640px, 100%);
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--green);
  background: #e8f3ef;
  white-space: normal;
  overflow-wrap: anywhere;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.sub-tabs {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.sub-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  min-height: 36px;
}

.sub-tab.active {
  color: var(--ink);
  border-bottom-color: var(--orange);
  background: #f7f8fa;
}

.sub-page {
  display: none;
}

.sub-page.active {
  display: block;
}

.compact-search {
  min-width: min(520px, 100%);
}

.draft-list-card,
.approval-card,
.finance-card {
  gap: 8px;
}

.progress-box {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.progress-grid strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.draft-detail-panel {
  display: grid;
  gap: 12px;
}

.detail-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.detail-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.field-pairs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  font-size: 13px;
}

.field-pairs div {
  display: grid;
  gap: 2px;
}

.field-pairs span {
  color: var(--muted);
  word-break: break-word;
}

.detail-section-title {
  margin-top: 8px;
  font-weight: 700;
}

.detail-grid-head,
.detail-edit-row {
  display: grid;
  grid-template-columns: 120px 150px 150px 100px minmax(160px, 1fr);
  gap: 6px;
  align-items: center;
  font-size: 12px;
}

.detail-grid-head.invoice-head,
.detail-edit-row.invoice-finance-row {
  grid-template-columns: 150px 150px 100px 90px 100px 130px;
}

.detail-edit-row input,
.detail-section textarea {
  min-height: 32px;
  padding: 6px 8px;
}

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

.detail-attachment-row {
  margin-top: 0;
}

.source-attachment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.source-attachment-row small {
  display: block;
  color: var(--muted);
}

.source-attachment-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.source-attachment-actions a {
  text-decoration: none;
}

.disabled-item {
  opacity: .58;
}

.rules-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.rules-side-panel {
  position: sticky;
  top: 16px;
}

.rules-summary,
.rules-form,
.discovery-template {
  display: grid;
  gap: 10px;
}

.rule-nav-list {
  gap: 6px;
}

.rule-nav-item {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 10px 11px;
  color: var(--ink);
  text-align: left;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.rule-nav-item strong {
  font-size: 14px;
}

.rule-nav-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.rule-nav-item.active {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.rule-nav-item.active span {
  color: rgba(255, 255, 255, .78);
}

.rule-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rule-detail-head h3 {
  margin-bottom: 3px;
}

.rule-summary-card,
.rule-edit-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.rule-summary-card strong,
.rule-edit-card h4 {
  display: block;
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--ink);
}

.rule-summary-card span,
.rule-summary-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.rule-summary-row {
  padding: 6px 0;
  border-top: 1px solid #eef0f4;
}

.rule-summary-row:first-of-type {
  border-top: 0;
}

.rule-edit-card {
  display: grid;
  gap: 8px;
}

.rule-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rule-card-head h4 {
  margin-bottom: 4px;
}

.user-admin-layout {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(480px, 1fr);
  gap: 12px;
  align-items: start;
}

.user-admin-list {
  order: 2;
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.user-admin-form {
  order: 1;
}

.user-card {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.user-card.active {
  border-color: var(--orange);
  background: #fff8ef;
}

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

.workflow-config-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.workflow-panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.workflow-panel-title span {
  color: var(--muted);
  font-size: 12px;
}

.workflow-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  padding: 10px;
  border: 1px dashed #cfd6e4;
  border-radius: 8px;
  background: #fff;
}

.workflow-step-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 210px;
  padding: 10px;
  border: 1px solid #cfd6e4;
  border-radius: 8px;
  background: #fff;
}

.workflow-step-index,
.flow-edit-card-head span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.workflow-step-body {
  display: grid;
  gap: 3px;
}

.workflow-step-body span,
.workflow-step-body small {
  color: var(--muted);
  font-size: 12px;
}

.workflow-connector,
.flow-edit-connector {
  align-self: center;
  width: 38px;
  height: 2px;
  background: #cfd6e4;
  position: relative;
}

.workflow-connector::after,
.flow-edit-connector::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -4px;
  border-left: 8px solid #cfd6e4;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.policy-node-editor,
.visibility-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.flow-edit-card {
  display: grid;
  gap: 8px;
  min-width: 260px;
  flex: 1 1 260px;
  max-width: 360px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow-edit-card-head {
  display: flex;
  gap: 8px;
  align-items: center;
}

.policy-node-head,
.policy-node-row {
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1fr) minmax(160px, 1fr) 72px;
}

.visibility-head,
.visibility-row {
  grid-template-columns: minmax(150px, 1fr) 120px minmax(160px, 1fr) minmax(160px, 1fr) 72px;
}

.rule-edit-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.rule-edit-card label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.rule-edit-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

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

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

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

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--ink);
  font-size: 13px;
}

.checkbox-grid input[type="checkbox"] {
  width: 15px;
  height: 15px;
}

.discovery-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.discovery-file-item button {
  flex: 0 0 auto;
}

.raw-rule-box {
  margin-top: 14px;
}

.field-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.field-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #f7f8fa;
  color: var(--ink);
  font-size: 12px;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.subpanel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.actions,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

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

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

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

label.required-attention {
  color: var(--red);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
}

.list,
.mini-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.source-scroll-box {
  max-height: 930px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.item.selected {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(238, 125, 34, .16);
}

.item-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
}

.item-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.result {
  overflow: auto;
  max-height: 280px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #111827;
  color: #f5f7fb;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: #f6f7f9;
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
}

.login-panel {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.login-logo {
  width: 250px;
  height: auto;
  margin-bottom: 20px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form button {
  margin-top: 4px;
}

.error {
  color: var(--red);
}


.sequential-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-start;
}

.sequential-actions button {
  min-width: 118px;
}

.action-step-arrow {
  color: var(--muted);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.risk-summary.risk-blocking {
  border-color: #c43d3d;
  background: #fff0f0;
  color: #9b1c1c;
  font-weight: 800;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .two-column,
  .rules-layout,
  .grid-form,
  .grid-form.compact {
    grid-template-columns: 1fr;
  }

  .rules-side-panel {
    position: static;
  }
}

.hidden {
  display: none !important;
}


.wide-field {
  grid-column: 1 / -1;
}

.muted-text {
  color: var(--muted);
}

.selected-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}

.selected-title,
.upload-title {
  margin-bottom: 8px;
  font-weight: 700;
}

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

.selected-total {
  color: var(--green);
  font-weight: 700;
}

.source-chip {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-left: 4px solid var(--orange);
  background: #fff;
}

.source-chip span {
  color: var(--muted);
  font-size: 13px;
}

.source-state {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: #f1f3f5;
  font-size: 13px;
}

.source-state.active {
  color: #fff;
  background: var(--green);
}

.erp-save-status {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--green);
  background: #e8f6ef;
  font-size: 14px;
  font-weight: 600;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

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

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

.feedback-box {
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  color: var(--ink);
  line-height: 1.55;
}

.feedback-box.pass-box {
  border-color: #a8d8c6;
  background: #edf8f3;
  color: var(--green);
}

.feedback-box.danger-box {
  border-color: #e2b1b1;
  background: #fff1f1;
  color: var(--red);
}

.allocation-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 130px minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

@media (max-width: 960px) {
  .upload-grid,
  .upload-row,
  .allocation-row {
    grid-template-columns: 1fr;
  }
}

button:disabled {
  background: #c5cad3 !important;
  color: #f8fafc !important;
  box-shadow: none;
}

.submit-panel {
  padding: 16px;
}

.doc-type-field {
  grid-column: 1 / -1;
  padding: 10px;
  border: 2px solid var(--orange);
  border-radius: 6px;
  background: #fff8ef;
}

.submit-panel.needs-doc-type::after {
  content: "请先选择单据类型；选择后再显示对应填报字段，防止差旅费、费用报销、费用申请填错格式。";
  display: block;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #e5c37b;
  border-radius: 6px;
  color: #7a5200;
  background: #fff8e8;
}

.compact-form {
  gap: 10px;
}

.compact-form input,
.compact-form select,
.compact-form textarea,
.invoice-entry-grid input,
.allocation-entry-grid input {
  min-height: 34px;
  padding: 7px 9px;
}

.reimbursement-payment-mode-field {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.reimbursement-payment-mode-field legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.reimbursement-payment-mode-field label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
}

.reimbursement-payment-mode-field input {
  min-height: 0;
  padding: 0;
}

.compact-subpanel {
  margin-top: 12px;
  padding-top: 10px;
}

.subpanel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.subpanel-title-row h4 {
  margin-bottom: 0;
}

.compact-hint {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.compact-list {
  gap: 8px;
  margin-top: 8px;
}

.compact-item {
  padding: 9px 10px;
}

.compact-box {
  padding: 10px;
}

.compact-upload-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin-bottom: 8px;
}

.compact-upload-grid {
  gap: 10px;
}

.compact-upload-card {
  gap: 7px;
  padding: 9px;
}

.compact-upload-card input,
.compact-upload-row input {
  min-height: 34px;
  padding: 6px 8px;
}

.compact-details {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.compact-details summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}

.invoice-entry-grid,
.allocation-entry-grid {
  margin-top: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.compact-allocation-row {
  grid-template-columns: minmax(120px, 1fr) 112px minmax(96px, 1fr) 42px;
  gap: 6px;
  padding: 7px;
}

.compact-allocation-row input {
  min-height: 32px;
  padding: 6px 8px;
}

.small-button {
  padding: 7px 8px;
}

.precheck-checklist {
  display: grid;
  gap: 10px;
}

.risk-summary {
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
}

.risk-low {
  color: var(--green);
  background: #edf8f3;
  border: 1px solid #a8d8c6;
}

.risk-high {
  color: var(--red);
  background: #fff1f1;
  border: 1px solid #e2b1b1;
}

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

.check-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.check-item span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
}

.check-item.ok span {
  background: var(--green);
}

.check-item.warn span {
  background: #a66f00;
}

.check-item.block span {
  background: var(--red);
}

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

.check-item small {
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

.backend-findings {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.action-bar {
  position: sticky;
  bottom: 0;
  padding: 10px 0 0;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

@media (max-width: 960px) {
  .check-grid,
  .field-pairs,
  .detail-grid-head,
  .detail-edit-row,
  .detail-grid-head.invoice-head,
  .detail-edit-row.invoice-finance-row,
  .detail-upload-row,
  .invoice-entry-grid,
  .allocation-entry-grid {
    grid-template-columns: 1fr;
  }
}

.field-with-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.invoice-upload-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.empty-line {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfd;
  font-size: 13px;
}

.invoice-card .compact-details {
  margin-top: 8px;
}

.invoice-verify {
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
}

.invoice-verify.pass {
  border-color: #a8d8c6;
  background: #edf8f3;
  color: var(--green);
}

.invoice-verify.warn {
  border-color: #e5c37b;
  background: #fff8e8;
  color: #8a6200;
}

.invoice-verify.fail {
  border-color: #e2b1b1;
  background: #fff1f1;
  color: var(--red);
}

.source-issues {
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid #e5c37b;
  border-radius: 6px;
  background: #fff8e8;
  color: #7a5200;
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
}

.row-actions a {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
}

.travel-entry-grid {
  margin-bottom: 8px;
}

.travel-row,
.compact-travel-row {
  display: grid;
  grid-template-columns: 132px minmax(90px, 1fr) minmax(90px, 1fr) 82px 82px 82px 92px 42px;
  gap: 6px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.travel-row input,
.allocation-row select,
.compact-allocation-row select {
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

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

.rule-editor {
  width: 100%;
  min-height: 140px;
  margin-top: 10px;
  font-family: Consolas, monospace;
  font-size: 13px;
}

@media (max-width: 960px) {
  .invoice-upload-row,
  .field-with-button,
  .travel-row,
  .compact-travel-row,
  .attachment-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .row-actions {
    justify-content: flex-start;
  }
}

.invoice-entry-grid label,
.travel-row label {
  color: var(--muted);
  font-size: 12px;
  gap: 4px;
}

.invoice-edit-actions,
.travel-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: end;
  margin-top: 8px;
}

.travel-actions {
  margin-top: 0;
}

.compact-travel-row {
  grid-template-columns: 128px minmax(86px, 1fr) minmax(86px, 1fr) 82px 82px 82px 92px auto;
}

.compact-travel-row label input {
  min-height: 32px;
}
