/* Scoped and premium styling rules for Contabilidad Module */

#accountingModule .accounting-module-intro,
#accountingModule .accounting-tabs {
  display: flex;
  align-items: center;
  gap: 12px;
}

#accountingModule .accounting-module-intro {
  justify-content: flex-start;
  margin: 0 0 14px;
}

#accountingModule .accounting-module-intro h2 {
  margin: 0;
  color: var(--text);
}

#accountingModule .accounting-module-intro p {
  margin: 6px 0 0;
  color: var(--muted);
}

#accountingModule .accounting-period-picker {
  display: grid;
  gap: 3px;
  min-width: 168px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#accountingModule .accounting-period-picker select {
  min-height: 38px;
  padding: 6px 34px 6px 10px;
  border: 0;
  border-bottom: 2px solid var(--brand);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

#accountingModule .accounting-tabs {
  width: max-content;
  max-width: 100%;
  gap: 2px;
  padding: 3px;
  margin: 0 0 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  overflow: visible;
}

#accountingModule .accounting-view-switcher__item {
  min-height: 34px;
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#accountingModule .accounting-view-switcher__item:hover { color: var(--text); }

#accountingModule .accounting-view-switcher__item.tab-button-active {
  background: var(--brand);
  color: #fff;
}

#accountingModule .accounting-detail-menu {
  position: relative;
}

#accountingModule .accounting-detail-menu summary {
  list-style: none;
}

#accountingModule .accounting-detail-menu summary::-webkit-details-marker {
  display: none;
}

#accountingModule .accounting-detail-menu summary::after {
  margin-left: 7px;
  content: "⌄";
}

#accountingModule .accounting-detail-menu__items {
  position: absolute;
  z-index: 4;
  top: calc(100% + 7px);
  right: 0;
  display: grid;
  min-width: 180px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

#accountingModule .accounting-detail-menu__items .accounting-view-switcher__item {
  width: 100%;
  text-align: left;
}

#accountingModule .accounting-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 7%, var(--panel)), var(--panel));
}

#accountingModule .accounting-overline,
#accountingModule .accounting-context p,
#accountingModule .kpi small {
  color: var(--muted);
  font-size: 12px;
}

#accountingModule .accounting-overline {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

#accountingModule .accounting-context h3 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
}

#accountingModule .accounting-context p { margin: 6px 0 0; max-width: 720px; }

#accountingModule .accounting-warning {
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid rgba(245, 158, 11, .28);
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, .08);
  color: var(--text);
  font-size: 13px;
}

#accountingModule .accounting-month-checklist {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
}

#accountingModule .accounting-month-checklist__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

#accountingModule .accounting-month-checklist__header h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
}

#accountingModule .accounting-month-checklist__header > span {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

#accountingModule .accounting-month-checklist__steps {
  display: grid;
  grid-template-columns: 1fr;
  padding: 0;
  margin: 0;
  list-style: none;
}

#accountingModule .accounting-month-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

#accountingModule .accounting-month-step:last-child { border-bottom: 0; }

#accountingModule .accounting-month-step.is-done {
  background: color-mix(in srgb, var(--ok) 4%, var(--panel));
}

#accountingModule .accounting-month-step input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: var(--ok);
  opacity: 1;
}

#accountingModule .accounting-month-step__copy {
  display: grid;
  gap: 3px;
}

#accountingModule .accounting-month-step__copy strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
}

#accountingModule .accounting-month-step__copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

#accountingModule .accounting-step-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

#accountingModule .accounting-step-action:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--border));
  background: color-mix(in srgb, var(--brand) 5%, var(--panel));
}

#accountingModule .accounting-step-action:active { transform: translateY(1px); }

#accountingModule .accounting-step-action:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brand) 50%, transparent);
  outline-offset: 2px;
}

#accountingModule .accounting-review-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

#accountingModule .accounting-review-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

#accountingModule .accounting-review-toolbar button {
  min-height: 30px;
  padding: 4px 10px;
}

#accountingModule .accounting-review-mode-switcher {
  margin-bottom: 10px;
}

#accountingModule .accounting-review-mode-switcher .accounting-filter-button {
  border: 1px solid transparent;
}

#accountingModule .accounting-review-mode-switcher .accounting-filter-button.is-active {
  border-color: color-mix(in srgb, var(--brand) 22%, var(--border));
}

#accountingModule .accounting-toolbar-label {
  margin-right: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

#accountingModule .accounting-filter-button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

#accountingModule .accounting-filter-button strong {
  display: inline-block;
  min-width: 19px;
  margin-left: 3px;
  color: inherit;
  font-variant-numeric: tabular-nums;
}

#accountingModule .accounting-filter-button.is-active {
  background: color-mix(in srgb, var(--brand) 10%, var(--panel));
  color: var(--brand);
}

#accountingModule .accounting-exception-panel { margin-top: 20px; }

#accountingModule .accounting-exception-list {
  display: grid;
}

#accountingModule .accounting-exception-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
}

#accountingModule .accounting-exception-card:last-child { border-bottom: 0; }
#accountingModule .accounting-exception-card--bad { border-left-color: var(--bad); }
#accountingModule .accounting-exception-card--warn { border-left-color: var(--warn); }
#accountingModule .accounting-exception-card--ok { border-left-color: var(--ok); }

#accountingModule .accounting-exception-meta {
  display: grid;
  justify-items: start;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

#accountingModule .accounting-exception-meta strong {
  color: var(--text);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

#accountingModule .accounting-exception-body h3 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 15px;
}

#accountingModule .accounting-exception-body p {
  margin: 3px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

#accountingModule .accounting-exception-body .accounting-exception-concept {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

#accountingModule .accounting-exception-question {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  margin-top: 10px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--brand) 6%, var(--panel));
  color: var(--text);
  font-size: 12px;
}

#accountingModule .accounting-exception-question span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}

#accountingModule .accounting-exception-saved-answer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 10px;
  padding: 10px 12px;
  margin-top: 10px;
  border-left: 3px solid var(--ok);
  background: color-mix(in srgb, var(--ok) 5%, var(--panel));
  color: var(--text);
  font-size: 12px;
}

#accountingModule .accounting-exception-saved-answer p,
#accountingModule .accounting-exception-saved-answer small {
  flex-basis: 100%;
  margin: 0;
}

#accountingModule .accounting-exception-response {
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}

#accountingModule .accounting-exception-response-head {
  min-height: 24px;
  margin-bottom: 8px;
}

#accountingModule .accounting-exception-owner,
#accountingModule .accounting-inline-action {
  color: var(--muted);
  font-size: 12px;
}

#accountingModule .accounting-inline-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

#accountingModule .accounting-inline-action:hover { text-decoration: underline; }

#accountingModule .accounting-exception-fields {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(180px, .8fr) minmax(260px, 1.4fr);
  gap: 9px;
}

#accountingModule .accounting-exception-fields.is-income {
  grid-template-columns: minmax(180px, .7fr) minmax(300px, 1.5fr) minmax(240px, 1.1fr);
}

#accountingModule .accounting-exception-fields label {
  display: grid;
  align-content: start;
  gap: 4px;
}

#accountingModule .accounting-exception-fields label[hidden] {
  display: none !important;
}

#accountingModule .accounting-exception-fields label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}

#accountingModule .accounting-exception-fields select,
#accountingModule .accounting-exception-fields input[type="search"],
#accountingModule .accounting-exception-fields textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

#accountingModule .accounting-invoice-picker-hint {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

#accountingModule .accounting-exception-fields textarea {
  resize: vertical;
  line-height: 1.35;
}

#accountingModule .accounting-exception-response-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 9px;
}

#accountingModule .accounting-exception-response-actions button {
  min-height: 32px;
  padding: 5px 11px;
  margin: 0;
}

#accountingModule .accounting-exception-response-actions small {
  color: var(--muted);
  font-size: 11px;
}

#accountingModule .accounting-exception-guidance,
#accountingModule .accounting-income-empty {
  display: grid;
  justify-items: start;
  gap: 3px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

#accountingModule .accounting-exception-guidance strong {
  color: var(--text);
  font-size: 12px;
}

#accountingModule .accounting-exception-card > button,
#accountingModule .accounting-exception-footer button { min-height: 32px; padding: 5px 11px; }

#accountingModule .accounting-exception-footer {
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  text-align: right;
}

#accountingModule .accounting-exception-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  margin-top: 20px;
  border: 1px solid color-mix(in srgb, var(--ok) 25%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--ok) 5%, var(--panel));
}

#accountingModule .accounting-exception-empty p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

#accountingModule .accounting-expense-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  width: 100%;
  gap: 24px;
  padding: 14px 24px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

#accountingModule .accounting-expense-row:last-child { border-bottom: 0; }
#accountingModule .accounting-expense-row:hover { background: rgba(29, 29, 27, 0.025); }
#accountingModule .accounting-expense-row strong { font-variant-numeric: tabular-nums; }
#accountingModule .accounting-expense-row small { color: var(--muted); font-size: 12px; white-space: nowrap; }
#accountingModule .kpi-positive strong { color: var(--ok); }
#accountingModule .kpi-negative strong { color: var(--bad); }
#accountingModule .accounting-difference { color: var(--warn); }

#accountingModule .accounting-workflow-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 8%, var(--panel)), var(--panel));
}

#accountingModule .accounting-workflow-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -.04em;
}

#accountingModule .accounting-workflow-hero p {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

#accountingModule .accounting-workflow-status {
  flex: 0 0 auto;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 750;
}

#accountingModule .accounting-workflow-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
}

#accountingModule .accounting-workflow-intro h2,
#accountingModule .accounting-source-card h2,
#accountingModule .accounting-workflow-group h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  letter-spacing: -.015em;
}

#accountingModule .accounting-workflow-intro p,
#accountingModule .accounting-source-card p,
#accountingModule .accounting-workflow-group header p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

#accountingModule .accounting-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

#accountingModule .accounting-source-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 188px;
  padding: 18px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--warn);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

#accountingModule .accounting-source-card.is-ready {
  border-top-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 3%, var(--panel));
}

#accountingModule .accounting-source-card__topline {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 14px;
}

#accountingModule .accounting-source-card__marker {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--muted) 12%, var(--panel));
  color: var(--muted);
  font-weight: 800;
}

#accountingModule .accounting-source-card.is-ready .accounting-source-card__marker {
  background: color-mix(in srgb, var(--ok) 16%, var(--panel));
  color: var(--ok);
}

#accountingModule .accounting-source-card p { min-height: 42px; margin-bottom: 18px; }
#accountingModule .accounting-source-card .primary-button { margin-top: auto; }
#accountingModule .accounting-source-card__note { margin-top: auto; color: var(--muted); font-size: 11px; }

#accountingModule .accounting-preparation-ready {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  margin-bottom: 14px;
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--border));
  border-left: 3px solid var(--ok);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--ok) 4%, var(--panel));
}

#accountingModule .accounting-preparation-ready h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 18px;
}

#accountingModule .accounting-preparation-ready p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

#accountingModule .accounting-source-list {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
}

#accountingModule .accounting-source-list > div {
  display: grid;
  grid-template-columns: minmax(160px, .55fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

#accountingModule .accounting-source-list > div:last-child { border-bottom: 0; }
#accountingModule .accounting-source-list > div > span:nth-child(2) { color: var(--muted); }

#accountingModule .accounting-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 7px;
  cursor: pointer;
}

#accountingModule .accounting-workflow-note {
  display: flex;
  gap: 9px;
  padding: 13px 16px;
  margin-bottom: 20px;
  border-left: 3px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 5%, var(--panel));
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

#accountingModule .accounting-workflow-note strong { color: var(--text); }

#accountingModule .accounting-automatic-proposals {
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border));
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--warn) 3%, var(--panel));
  overflow: hidden;
}

#accountingModule .accounting-automatic-proposals > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

#accountingModule .accounting-automatic-proposals h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 17px;
}

#accountingModule .accounting-automatic-proposals p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

#accountingModule .accounting-automatic-proposal-list { display: grid; }

#accountingModule .accounting-automatic-proposal {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
  gap: 14px 20px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

#accountingModule .accounting-automatic-proposal:last-child { border-bottom: 0; }
#accountingModule .accounting-automatic-proposal div { display: grid; gap: 4px; }
#accountingModule .accounting-automatic-proposal span { color: var(--muted); font-size: 11px; line-height: 1.35; }
#accountingModule .accounting-automatic-proposal strong { color: var(--text); font-size: 12px; }

#accountingModule .accounting-resolver-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
}

#accountingModule .accounting-resolver-intro h2,
#accountingModule .accounting-decision-group h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  letter-spacing: -.015em;
}

#accountingModule .accounting-resolver-intro p,
#accountingModule .accounting-decision-group__header p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

#accountingModule .accounting-resolver-summary {
  display: grid;
  min-width: 112px;
  padding: 10px 14px;
  border-left: 3px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--panel));
  text-align: right;
}

#accountingModule .accounting-resolver-summary strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#accountingModule .accounting-resolver-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

#accountingModule .accounting-result-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 16px;
  border-left: 3px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 6%, var(--panel));
  color: var(--muted);
  font-size: 12px;
}

#accountingModule .accounting-result-notice strong { color: var(--text); }
#accountingModule .accounting-result-notice .accounting-inline-action { margin-left: auto; }

#accountingModule .accounting-decision-group {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
}

#accountingModule .accounting-decision-group__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

#accountingModule .accounting-decision-group__header > strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

#accountingModule .accounting-decision-list { display: grid; }

#accountingModule .accounting-decision-card {
  display: grid;
  grid-template-columns: 150px minmax(220px, .75fr) minmax(360px, 1.25fr);
  gap: 16px 20px;
  align-items: start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--warn);
}

#accountingModule .accounting-decision-card:last-child { border-bottom: 0; }

#accountingModule .accounting-decision-meta {
  display: grid;
  justify-items: start;
  gap: 7px;
}

#accountingModule .accounting-decision-meta time,
#accountingModule .accounting-decision-meta strong {
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#accountingModule .accounting-decision-copy h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

#accountingModule .accounting-decision-copy p {
  margin: 5px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

#accountingModule .accounting-decision-copy > strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

#accountingModule .accounting-decision-form {
  display: grid;
  gap: 10px;
  min-width: 0;
}

#accountingModule .accounting-decision-form label,
#accountingModule .accounting-decision-form [data-exception-invoice-field] {
  display: grid;
  gap: 5px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

#accountingModule .accounting-decision-form input[type="search"],
#accountingModule .accounting-decision-form select,
#accountingModule .accounting-decision-form textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

#accountingModule .accounting-decision-form textarea { min-height: 58px; resize: vertical; }

#accountingModule .accounting-decision-form [data-exception-invoice-field] {
  grid-template-columns: minmax(0, 1fr);
}

#accountingModule .accounting-decision-form [data-exception-invoice-field] > span,
#accountingModule .accounting-decision-form .accounting-invoice-picker-hint { grid-column: 1; }

#accountingModule .accounting-decision-form .accounting-invoice-picker-hint,
#accountingModule .accounting-decision-reason,
#accountingModule .accounting-decision-guidance {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

#accountingModule .accounting-decision-reason {
  padding: 8px 10px;
  border-left: 2px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 5%, var(--panel));
}

#accountingModule .accounting-decision-options {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

#accountingModule .accounting-decision-options legend {
  margin-bottom: 2px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

#accountingModule .accounting-decision-option {
  display: flex !important;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--brand) 2%, var(--panel));
  cursor: pointer;
}

#accountingModule .accounting-decision-option:has(input:checked) {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--panel));
}

#accountingModule .accounting-decision-option input { margin-top: 3px; }
#accountingModule .accounting-decision-option > span { display: grid; gap: 5px; min-width: 0; }
#accountingModule .accounting-decision-option strong { color: var(--text); font-size: 11px; }
#accountingModule .accounting-decision-option small { color: var(--muted); font-size: 11px; }

#accountingModule .accounting-decision-invoice { display: grid; gap: 2px; }
#accountingModule .accounting-decision-invoice span { color: var(--muted); font-size: 11px; }

#accountingModule .accounting-decision-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#accountingModule .accounting-decision-actions .primary-button { margin: 0; }

#accountingModule .accounting-decision-explanation {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--warn) 3%, var(--panel));
}

#accountingModule .accounting-decision-explanation[hidden] { display: none; }

#accountingModule .accounting-decision-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  color: var(--muted);
  font-size: 13px;
}

#accountingModule .accounting-workflow-group {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  overflow: hidden;
}

#accountingModule .accounting-workflow-group > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

#accountingModule .accounting-workflow-group > header > strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

#accountingModule .accounting-workflow-exception-list { display: grid; }

#accountingModule .accounting-workflow-exception {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 14px 18px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--bad);
}

#accountingModule .accounting-workflow-exception:last-child { border-bottom: 0; }
#accountingModule .accounting-workflow-exception h3 { margin: 0; color: var(--text); font-size: 14px; }
#accountingModule .accounting-workflow-exception p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

#accountingModule .accounting-workflow-exception-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#accountingModule .accounting-inline-invoice-match {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

#accountingModule .accounting-inline-invoice-match [data-exception-invoice-field] {
  display: grid;
  grid-template-columns: minmax(180px, .65fr) minmax(300px, 1.35fr);
  gap: 5px 8px;
}

#accountingModule .accounting-inline-invoice-match [data-exception-invoice-field] > span,
#accountingModule .accounting-inline-invoice-match .accounting-invoice-picker-hint {
  grid-column: 1 / -1;
}

#accountingModule .accounting-inline-invoice-match [data-exception-invoice-field] > span {
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

#accountingModule .accounting-inline-invoice-match input[type="search"],
#accountingModule .accounting-inline-invoice-match select {
  width: 100%;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

#accountingModule .accounting-inline-invoice-actions {
  display: grid;
  justify-items: start;
  gap: 7px;
  min-width: 170px;
}

#accountingModule .accounting-inline-invoice-actions .primary-button { margin: 0; }

#accountingModule .accounting-workflow-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  color: var(--muted);
  font-size: 13px;
}

#accountingModule .accounting-load-state {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 34px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

#accountingModule .accounting-load-state strong { color: var(--text); font-size: 17px; }
#accountingModule .accounting-load-state p { margin: 0; color: var(--muted); font-size: 13px; }
#accountingModule .accounting-load-state--error { border-color: color-mix(in srgb, var(--bad) 35%, var(--border)); }
#accountingModule .accounting-load-state--error strong { color: var(--bad); }
#accountingModule .accounting-load-state__bar {
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 12%, var(--panel)), var(--brand));
  background-size: 200% 100%;
  animation: accountingLoading 1.2s ease-in-out infinite;
}

@keyframes accountingLoading {
  from { background-position: 0 0; }
  to { background-position: 200% 0; }
}

@media (max-width: 900px) {
  #accountingModule .accounting-workflow-hero,
  #accountingModule .accounting-workflow-intro,
  #accountingModule .accounting-resolver-intro { align-items: stretch; flex-direction: column; }
  #accountingModule .accounting-decision-group__header { flex-direction: column; }
  #accountingModule .accounting-decision-card { grid-template-columns: 1fr; }
  #accountingModule .accounting-decision-meta { grid-template-columns: repeat(3, max-content); align-items: center; }
}

@media (max-width: 760px) {
  #accountingModule .accounting-module-intro,
  #accountingModule .accounting-context { align-items: stretch; flex-direction: column; }
  #accountingModule .accounting-detail-menu__items { right: auto; left: 0; }
  #accountingModule .accounting-expense-row { grid-template-columns: 1fr auto; gap: 5px 14px; }
  #accountingModule .accounting-expense-row small { grid-column: 1 / -1; }
  #accountingModule .accounting-exception-card { grid-template-columns: 1fr; }
  #accountingModule .accounting-exception-fields { grid-template-columns: 1fr; }
  #accountingModule .accounting-month-step { grid-template-columns: auto minmax(0, 1fr); }
  #accountingModule .accounting-step-action { grid-column: 2; justify-self: start; }
  #accountingModule .accounting-workflow-hero,
  #accountingModule .accounting-workflow-intro,
  #accountingModule .accounting-resolver-intro { align-items: stretch; flex-direction: column; }
  #accountingModule .accounting-source-grid { grid-template-columns: 1fr; }
  #accountingModule .accounting-source-card { min-height: 0; }
  #accountingModule .accounting-workflow-group > header { flex-direction: column; }
  #accountingModule .accounting-automatic-proposals > header { flex-direction: column; }
  #accountingModule .accounting-automatic-proposal { grid-template-columns: 1fr; }
  #accountingModule .accounting-workflow-exception { grid-template-columns: 1fr; }
  #accountingModule .accounting-workflow-exception-actions { justify-content: flex-start; }
  #accountingModule .accounting-inline-invoice-match { grid-column: 1; grid-template-columns: 1fr; }
  #accountingModule .accounting-inline-invoice-match [data-exception-invoice-field] { grid-template-columns: 1fr; }
  #accountingModule .accounting-inline-invoice-match [data-exception-invoice-field] > span,
  #accountingModule .accounting-inline-invoice-match .accounting-invoice-picker-hint { grid-column: 1; }
  #accountingModule .accounting-decision-group__header { flex-direction: column; }
  #accountingModule .accounting-decision-card { grid-template-columns: 1fr; }
  #accountingModule .accounting-decision-meta { grid-template-columns: repeat(3, max-content); align-items: center; }
  #accountingModule .accounting-resolver-summary { justify-items: start; text-align: left; }
  #accountingModule .accounting-preparation-ready { align-items: stretch; flex-direction: column; }
  #accountingModule .accounting-source-list > div { grid-template-columns: 1fr; gap: 6px; }
  #accountingModule .accounting-result-notice { align-items: flex-start; flex-wrap: wrap; }
  #accountingModule .accounting-result-notice .accounting-inline-action { margin-left: 0; }
}

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

#accountingModule .kpi {
  position: relative;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

#accountingModule .kpi:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
}

#accountingModule .kpi span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#accountingModule .kpi strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

#accountingModule .panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

#accountingModule .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.01);
}

#accountingModule .panel-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

#accountingModule .panel-header p {
  margin: 4px 0 0 0;
  color: var(--muted);
  font-size: 12px;
}

#accountingModule .table-wrap {
  overflow-x: auto;
}

#accountingModule table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

#accountingModule th,
#accountingModule td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

#accountingModule th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.01);
}

#accountingModule td {
  font-size: 13.5px;
  color: var(--text);
}

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

#accountingModule tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

#accountingModule .money {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

/* Premium Status Pill badges */
#accountingModule .status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

#accountingModule .status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

#accountingModule .status.ok {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.15);
  color: var(--ok);
}

#accountingModule .status.warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.15);
  color: var(--warn);
}

#accountingModule .status.tag {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--border);
  color: var(--muted);
}

#accountingModule .status.bad {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: var(--bad);
}

#accountingModule .accounting-review-decision {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

#accountingModule .accounting-review-decision:last-child { margin-bottom: 0; }
#accountingModule .accounting-review-decision:hover { color: var(--text); text-decoration: underline; }
#accountingModule .accounting-review-decision.is-approve { color: var(--brand); }

#accountingModule .accounting-cash-picker {
  display: grid;
  gap: 5px;
  min-width: 210px;
}

#accountingModule .accounting-cash-picker select {
  width: 100%;
  max-width: 300px;
  min-height: 32px;
  padding: 5px 28px 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

#accountingModule .accounting-income-status {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 210px;
}

#accountingModule .accounting-income-status > small {
  color: var(--muted);
  line-height: 1.35;
}

#accountingModule .accounting-income-picker {
  display: grid;
  gap: 5px;
  width: 100%;
  max-width: 340px;
}

#accountingModule .accounting-income-picker select {
  width: 100%;
  min-height: 32px;
  padding: 5px 28px 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

#accountingModule .empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: rgba(0, 0, 0, 0.01);
  color: var(--muted);
  font-size: 14px;
}

/* Modals styling rules (global overlay/content) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 90%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  color: var(--text);
  animation: slideUp 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
#accountingModule .accounting-load-error {
  border: 1px solid var(--bad);
  color: var(--bad);
  padding: 16px;
}
