@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --bg: #edf1f3;
  --bg-2: #f8fafb;
  --card: #ffffff;
  --line: #d6dce1;
  --ink: #2d363e;
  --muted: #5f6b75;
  --navy: #003764;
  --navy-deep: #022b4c;
  --sky: #00a9f7;
  --sky-soft: #d8f2ff;
  --danger: #bf2e2e;
  --warn: #c98200;
  --ok: #1a8f53;
  --shadow: 0 14px 34px rgba(0, 27, 48, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 18% -4%, #ffffff 0%, #e8f5ff 28%, transparent 48%),
    radial-gradient(circle at 82% 0%, #d8ecff 0%, transparent 36%),
    linear-gradient(180deg, #f7fafc 0%, var(--bg) 58%, #e7ecef 100%);
  min-height: 100vh;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  color: #f4fbff;
  background:
    linear-gradient(160deg, rgba(0, 169, 247, 0.22), transparent 48%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-bottom: 4px solid var(--sky);
  box-shadow: 0 10px 20px rgba(0, 28, 49, 0.28);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--sky) 0%, #4bc6ff 100%);
  color: var(--navy-deep);
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: 'Oswald', sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.38);
}

.brand h1 {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 1.22rem;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.brand p {
  margin: 0;
  font-size: 0.9rem;
  color: #c3deef;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.topbar nav a {
  color: #d8f2ff;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.38rem 0.8rem;
  font-size: 0.92rem;
}

.topbar nav a:hover,
.topbar nav a.active {
  color: #fff;
  border-color: rgba(0, 169, 247, 0.5);
  background: rgba(0, 169, 247, 0.2);
}

.container {
  max-width: 1280px;
  margin: 1.35rem auto 2.1rem;
  padding: 0 1rem;
}

.panel-app {
  margin-top: 0.8rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  padding: 1rem;
}

.card h2,
.card h3 {
  margin-top: 0;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.hero {
  background:
    radial-gradient(circle at 95% 0%, rgba(0, 169, 247, 0.2), transparent 35%),
    linear-gradient(180deg, #fdfefe 0%, var(--bg-2) 100%);
  border-color: #c8d4dc;
}

.mini-card {
  border: 1px solid #d4dce2;
  background: #fff;
  border-radius: 13px;
  padding: 0.78rem;
}

.mini-card h3 {
  margin-bottom: 0.45rem;
}

.quarter-card {
  border-top: 4px solid #78b9df;
  background: linear-gradient(180deg, #ffffff 0%, #f4fbff 100%);
}

.progress-wrap {
  background: #f4f9fd;
  border: 1px solid #cfe0eb;
  border-radius: 12px;
  padding: 0.7rem;
  margin-bottom: 0.8rem;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.95rem;
  margin-bottom: 0.45rem;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #dce7ef;
  overflow: hidden;
}

.progress-value {
  height: 100%;
  background: linear-gradient(90deg, #2d9ee0 0%, #13b57f 100%);
}

.funnel-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.funnel-step {
  border: 1px solid #d5e0e8;
  border-left: 6px solid #b6c5d2;
  border-radius: 12px;
  background: #fff;
  padding: 0.8rem;
}

.funnel-step.is-done {
  border-left-color: #1ea567;
  background: #f3fff8;
}

.funnel-step.is-active {
  border-left-color: #1a7fcb;
  background: #f2f9ff;
}

.funnel-step.is-todo {
  border-left-color: #c3ccd4;
  background: #fbfcfd;
}

.funnel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.funnel-top h3 {
  margin: 0;
}

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

.grid {
  display: grid;
  gap: 1rem;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}

.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.grid.four {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.grid.compact {
  align-items: end;
}

.full {
  grid-column: 1 / -1;
}

.stat {
  border-top: 5px solid #bed4df;
}

.stat p {
  margin: 0;
  font-size: 1.76rem;
  line-height: 1.1;
  font-weight: 700;
}

.stat.warn {
  border-top-color: #ffb341;
}

.stat.ok {
  border-top-color: #2cbf74;
}

.stat.danger {
  border-top-color: #ee6e6e;
}

label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select,
textarea,
button {
  margin-top: 0.35rem;
  width: 100%;
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid #cbd6df;
  border-radius: 10px;
  padding: 0.56rem 0.68rem;
  background: #fff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(0, 169, 247, 0.25);
  border-color: #2abaf8;
}

button,
.btn {
  border: 1px solid #b9c7d3;
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.52rem 0.83rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  width: auto;
}

.btn.primary,
button.primary {
  color: #fff;
  border-color: var(--navy);
  background: linear-gradient(180deg, #01508f 0%, var(--navy) 100%);
}

.btn.primary:hover,
button.primary:hover {
  filter: brightness(1.05);
}

.btn.ghost {
  background: #f6fbff;
}

.btn.warn,
button.warn {
  border-color: #e0b06f;
  background: #fff4e6;
  color: #8a4f0e;
}

.btn.mini {
  font-size: 0.76rem;
  padding: 0.27rem 0.52rem;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.inline {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.inline select {
  margin-top: 0;
  width: auto;
  min-width: 170px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.inline-actions form {
  margin: 0;
}

.stack-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.steps {
  margin-top: 0;
  padding-left: 1.2rem;
}

.steps.big li {
  margin-bottom: 0.8rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: #fff;
  border-radius: 12px;
}

th,
td {
  border-bottom: 1px solid #e0e7ec;
  text-align: left;
  vertical-align: top;
  padding: 0.53rem;
}

th {
  color: #1f2a33;
  background: #edf6fd;
  position: sticky;
  top: 0;
  z-index: 1;
}

.badge {
  display: inline-block;
  border: 1px solid;
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  background: #fff;
}

.badge.ok {
  color: var(--ok);
  border-color: #9be3bd;
  background: #f0fff7;
}

.badge.warn {
  color: var(--warn);
  border-color: #ffd586;
  background: #fff9ec;
}

.badge.danger {
  color: var(--danger);
  border-color: #f4a4a4;
  background: #fff1f1;
}

.kpi-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #d5dde3;
  padding: 0.39rem 0;
}

.kpi-row.total {
  border-bottom: none;
  font-size: 1.04rem;
}

.alert {
  border: 1px solid;
  border-radius: 10px;
  padding: 0.68rem 0.83rem;
  margin: 0.5rem 0 1rem;
}

.alert.success {
  border-color: #9be3bd;
  color: #1e7d49;
  background: #effff6;
}

.alert.warn {
  border-color: #ffd586;
  color: #9a6608;
  background: #fff9eb;
}

.alert.danger {
  border-color: #f4a4a4;
  color: #9f2626;
  background: #fff1f1;
}

.phase-guide {
  border-top: 5px solid #6ba9cc;
}

.phase-line {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.7rem;
}

.phase-line li {
  border: 1px solid #d6e1e8;
  border-radius: 12px;
  background: #fcfeff;
  padding: 0.8rem;
}

.phase-line li p {
  margin: 0.38rem 0 0;
}

.phase-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.missing-text {
  color: #b12f2f;
  font-weight: 600;
}

.field-missing {
  color: #9f2626;
}

.field-missing input {
  border-color: #f1a5a5;
  background: #fff5f5;
}

.field-missing select,
.field-missing textarea {
  border-color: #f1a5a5;
  background: #fff5f5;
}

.preview-doc-frame {
  border: 1px solid #d4dee6;
  border-radius: 12px;
  background: #f7fbfe;
  min-height: 120px;
  margin-bottom: 0.9rem;
  overflow: hidden;
}

.preview-doc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #d6e2ea;
  background: #f3f8fc;
}

.preview-doc-toolbar strong {
  font-size: 0.92rem;
}

.preview-doc-viewport {
  background: #fff;
  max-height: 560px;
  overflow: auto;
}

.preview-doc-frame iframe {
  display: block;
  width: 100%;
  min-height: 560px;
  border: 0;
  background: #fff;
}

.route-preview {
  margin: 0.85rem 0;
  padding: 0.62rem 0.72rem;
  border-radius: 10px;
  background: #f1f7fb;
  border: 1px solid #d3e0e9;
}

.route-preview code {
  color: #0d3f67;
  font-weight: 600;
  font-size: 0.86rem;
}

.mock-hero {
  border-top: 5px solid #3b8bb9;
}

.mock-tabs-wrap {
  padding: 0.65rem;
  border-color: #c4d4df;
  background: linear-gradient(180deg, #fafdff 0%, #f2f8fc 100%);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 8px 18px rgba(0, 27, 48, 0.12);
}

.mock-tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.mock-tabs-nav a {
  text-decoration: none;
  color: #174a6c;
  border: 1px solid #c7d9e6;
  background: #f6fbff;
  border-radius: 10px;
  padding: 0.42rem 0.8rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.mock-tabs-nav a.active {
  color: #fff;
  border-color: #0f5a87;
  background: linear-gradient(180deg, #1478b0 0%, #0f5a87 100%);
}

.mock-file-box {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
}

.mock-filter-wrap {
  margin: 0.65rem 0;
}

.mock-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.35rem;
}

.mock-chip {
  text-decoration: none;
  border: 1px solid #c9d9e6;
  background: #f5fafe;
  color: #124765;
  border-radius: 999px;
  padding: 0.24rem 0.62rem;
  font-size: 0.84rem;
  font-weight: 600;
}

.mock-chip.active {
  border-color: #0f5a87;
  background: #0f5a87;
  color: #fff;
}

.erp-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  row-gap: 0.62rem;
  align-items: flex-end;
  margin-top: 0.65rem;
  overflow: visible;
  padding: 0.62rem;
  border: 1px solid #d4e1ea;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f9fd 100%);
}

.erp-filter-field {
  min-width: 0;
  flex: 1 1 170px;
}

.erp-filter-field--search {
  flex: 2 1 290px;
}

.erp-filter-field--state {
  flex: 1 1 100%;
}

.erp-filter-field--date {
  flex: 0 1 150px;
}

.erp-filter-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.18rem;
}

.erp-filter-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  align-items: center;
}

.erp-filter-segments .mock-chip {
  border-radius: 10px;
  padding: 0.33rem 0.72rem;
  font-size: 0.82rem;
}

.erp-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: flex-end;
  margin-left: auto;
  flex: 0 1 auto;
}

.flow-top-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: space-between;
  align-items: center;
}

.flow-top-head h2 {
  margin: 0;
}

.flow-filter-bar {
  margin-top: 0.55rem;
}

.conciliation-helper {
  margin: 0.32rem 0 0;
}

.conciliation-filters {
  margin-top: 0.45rem;
}

.conciliation-steps {
  margin-top: 0.45rem;
}

.conciliation-steps .mini-card {
  margin-bottom: 0;
}

.conciliation-filters .erp-filter-field--state {
  flex: 1 1 340px;
}

.conciliation-filters .erp-filter-field--search {
  flex: 2 1 320px;
}

.conciliation-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.conciliation-table th,
.conciliation-table td {
  white-space: normal;
  vertical-align: top;
  word-break: break-word;
}

.flow-table-wrap.conciliation-table-wrap {
  overflow-x: visible;
}

.flow-table-wrap.conciliation-table-wrap table {
  min-width: 0;
}

.conciliation-table th.amount-col,
.conciliation-table td.amount-col {
  width: 115px;
  text-align: right;
  white-space: nowrap;
}

.conciliation-table th.sel-col,
.conciliation-table td.sel-col {
  width: 52px;
  text-align: center;
  white-space: nowrap;
}

.conciliation-table th.action-col,
.conciliation-table td.action-col {
  width: 160px;
  white-space: nowrap;
}

.conciliation-link-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.conciliation-link-head h2 {
  margin: 0;
}

.conciliation-row-hint {
  margin: 0.2rem 0 0.55rem;
}

.conciliation-actions-dock {
  margin-top: 0.2rem;
}

.conciliation-match-form {
  margin-top: 0.15rem;
}

.conciliation-selection-state {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.conciliation-dock-actions {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}

.conciliation-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: end;
}

.conciliation-inline-form label {
  display: grid;
  gap: 0.14rem;
  font-weight: 600;
  color: #213544;
  min-width: 140px;
}

.conciliation-inline-form label input {
  margin-top: 0;
}

.conciliation-inline-cash label {
  min-width: 170px;
}

.conciliation-inline-cash input {
  margin-top: 0;
}

.conciliation-batch-amount {
  display: grid;
  gap: 0.14rem;
  font-weight: 600;
  color: #213544;
  min-width: 220px;
}

.conciliation-batch-amount input {
  margin-top: 0;
}

.conciliation-cash-panel {
  margin-top: 0.45rem;
}

.row-select-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  cursor: pointer;
}

.row-select-check input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.row-select-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid #9fbcd0;
  background: #fff;
  color: transparent;
  font-weight: 800;
}

.row-select-check input:checked + .row-select-indicator {
  border-color: #0a4669;
  background: #0f5a87;
  color: #fff;
}

.row-select-check input:focus-visible + .row-select-indicator {
  outline: 2px solid #89b7d7;
  outline-offset: 1px;
}

.row-select-indicator.active {
  border-color: #0a4669;
  background: #0f5a87;
  color: #fff;
}

.conciliation-link-form {
  margin-top: 0.62rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.62rem;
  align-items: end;
}

.conciliation-link-form > label {
  display: grid;
  gap: 0.2rem;
  font-weight: 600;
  color: #213544;
}

.conciliation-link-actions {
  display: flex;
  align-items: end;
}

.conciliation-link-actions .btn {
  white-space: nowrap;
}

.conciliation-link-actions-form {
  margin-top: 0.62rem;
  border-top: 1px solid #d8e5ef;
  padding-top: 0.62rem;
}

.conciliation-link-actions-form .muted {
  margin: 0.45rem 0 0;
}

.conciliation-link-visual {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.62rem;
}

.pick-card {
  border: 1px solid #d8e4ed;
  border-radius: 10px;
  padding: 0.6rem;
  background: #f8fbfe;
}

.pick-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}

.pick-card p {
  margin: 0.2rem 0;
}

.pick-card.selected {
  border-color: #9ac6e4;
  background: #eef7ff;
}

.pick-card.empty {
  border-style: dashed;
  background: #fbfdff;
}

.pick-amount {
  font-weight: 800;
  color: #0c3f62;
}

.conciliation-match-line {
  margin: 0.6rem 0 0.2rem;
  border-radius: 10px;
  padding: 0.45rem 0.62rem;
  font-weight: 700;
}

.conciliation-match-line.ok {
  border: 1px solid #8ed5b4;
  background: #eafaf2;
  color: #1f744e;
}

.conciliation-match-line.warn {
  border: 1px solid #f1c48b;
  background: #fff6ea;
  color: #915b16;
}

.conciliation-cash-form {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.62rem;
  align-items: end;
  border-top: 1px solid #d8e5ef;
  padding-top: 0.62rem;
}

.conciliation-cash-form > label {
  display: grid;
  gap: 0.2rem;
  font-weight: 600;
  color: #213544;
}

.conciliation-cash-form .muted {
  margin: 0.15rem 0 0;
}

.conciliation-click-row {
  cursor: pointer;
}

.conciliation-click-row:hover td {
  background: #f2f9ff;
}

.conciliation-click-row.row-active td {
  background: #d4ebff;
  box-shadow: inset 0 0 0 2px #5d97c1;
}

.conciliation-table tr:has(.row-select-check input:checked) td {
  background: #d4ebff;
  box-shadow: inset 0 0 0 2px #5d97c1;
}

.conciliation-diff-card {
  margin-top: 0.55rem;
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.45rem;
}

.conciliation-diff-card p {
  margin: 0;
}

.conciliation-diff-card.ok {
  border: 1px solid #8ed5b4;
  background: #eafaf2;
}

.conciliation-diff-card.warn {
  border: 1px solid #f1c48b;
  background: #fff6ea;
}

.conciliation-cash-help {
  margin: 0;
  max-width: 400px;
  font-size: 0.84rem;
  color: #4c6375;
}

.conciliation-exceptions-table td:nth-child(7) {
  min-width: 220px;
  white-space: normal;
}

.flow-send-alert {
  margin: 0.6rem 0 0.85rem;
}

.flow-list-meta {
  margin: 0.1rem 0 0.45rem;
}

.invoice-top-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: space-between;
  align-items: center;
}

.invoice-top-head h2 {
  margin: 0;
}

.invoice-filters {
  margin-top: 0.45rem;
}

.invoice-results-meta {
  margin: 0.2rem 0 0;
}

.provider-top-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: space-between;
  align-items: center;
}

.provider-top-head h2 {
  margin: 0;
}

.provider-results-meta {
  margin: 0.25rem 0 0;
}

.provider-help-line {
  margin: 0.35rem 0 0.15rem;
}

.fiscal-path-helper {
  margin: 0.45rem 0 0;
}

.fiscal-grid-tight {
  gap: 0.6rem;
}

.fiscal-period-card {
  border-left: 5px solid #c7d5e1;
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}

.fiscal-period-card h3 {
  margin: 0;
}

.fiscal-card-main {
  margin: 0.2rem 0;
}

.fiscal-period-card.ok {
  border-left-color: #25b56c;
}

.fiscal-period-card.warn {
  border-left-color: #f2ad38;
}

.fiscal-period-card.danger {
  border-left-color: #e56565;
}

.fiscal-period-card.empty {
  border-left-color: #c7d5e1;
  opacity: 0.75;
}

.fiscal-table td,
.fiscal-table th {
  vertical-align: top;
}

.providers-simple-filters {
  margin-top: 0.45rem;
}

.provider-editor-card h3 {
  margin: 0 0 0.55rem;
}

.provider-edit-form {
  display: grid;
  gap: 0.7rem;
}

.provider-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.provider-edit-grid > label {
  display: grid;
  gap: 0.2rem;
}

.provider-address-field {
  grid-column: 1 / -1;
}

.provider-address-field textarea {
  width: 100%;
  min-height: 3rem;
  margin-top: 0;
  resize: vertical;
}

.provider-edit-actions {
  margin: 0;
}

.provider-contact-line {
  line-height: 1.2;
}

.provider-inline-edit td {
  white-space: normal;
}

.provider-inline-panel {
  padding: 0.7rem;
  border: 1px solid #d8e6f1;
  border-radius: 10px;
  background: #fff;
}

.provider-source-doc {
  padding: 0.55rem 0.65rem;
  border: 1px solid #d8e6f1;
  border-radius: 10px;
  background: #f8fcff;
}

.provider-source-title {
  margin: 0;
  font-weight: 700;
  color: #2a516f;
}

.provider-source-name {
  margin: 0.2rem 0 0;
}

.provider-source-actions {
  margin: 0.35rem 0 0;
}

.invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.invoice-status-badge {
  min-width: 110px;
  text-align: center;
  font-weight: 700;
}

.invoice-conc-badge {
  min-width: 96px;
  text-align: center;
  border-radius: 8px;
  font-weight: 700;
}

.invoice-click-row {
  cursor: pointer;
}

.invoice-click-row:hover td {
  background: #f4faff;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid #c8d9e5;
  background: #f6fbff;
  color: #174a6c;
  text-decoration: none;
}

.icon-btn.ghost {
  background: #fff;
}

.icon-btn:hover {
  border-color: #0f5a87;
  color: #0f5a87;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentcolor;
}

.invoice-expand-content {
  padding: 0.75rem;
  border: 1px solid #d8e6f1;
  border-radius: 12px;
  background: #fff;
}

.invoice-state-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.7rem;
}

.invoice-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.invoice-tab {
  text-decoration: none;
  color: #174a6c;
  border: 1px solid #c7d9e6;
  background: #f6fbff;
  border-radius: 999px;
  padding: 0.22rem 0.62rem;
  font-size: 0.84rem;
  font-weight: 600;
}

.invoice-tab.active {
  color: #fff;
  border-color: #0f5a87;
  background: #0f5a87;
}

.invoice-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.55rem;
}

.invoice-edit-form {
  display: grid;
  gap: 0.65rem;
}

.invoice-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.6rem;
}

.invoice-edit-grid > label {
  display: grid;
  gap: 0.2rem;
}

.invoice-edit-grid textarea {
  width: 100%;
  margin-top: 0;
  resize: vertical;
}

.invoice-edit-wide {
  grid-column: 1 / -1;
}

.invoice-detail-item {
  border: 1px solid #d7e1ea;
  border-radius: 10px;
  background: #fbfdff;
  padding: 0.55rem 0.62rem;
}

.invoice-detail-item span {
  display: block;
  color: #586774;
  font-size: 0.79rem;
  margin-bottom: 0.16rem;
}

.invoice-detail-item strong {
  font-size: 0.9rem;
}

.invoice-info-block {
  border: 1px solid #d6e2ea;
  border-radius: 10px;
  background: #fbfdff;
  padding: 0.72rem;
}

.invoice-conc-meta {
  margin: 0.3rem 0 0.55rem;
}

.invoice-conc-form {
  display: grid;
  gap: 0.6rem;
}

.invoice-conc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem;
}

.invoice-conc-field {
  display: grid;
  gap: 0.2rem;
  font-weight: 600;
  color: #213544;
}

.invoice-conc-field select,
.invoice-conc-field input {
  width: 100%;
  margin-top: 0;
}

.invoice-conc-hint {
  font-weight: 500;
  font-size: 0.78rem;
  line-height: 1.25;
}

.invoice-history-table {
  margin: 0;
}

.invoice-note-line {
  margin: 0.55rem 0 0;
}

.engine-hero {
  border-top: 5px solid #2f88be;
  background: linear-gradient(180deg, #ffffff 0%, #f4fbff 100%);
}

.engine-kpis {
  margin: 0.45rem 0 0;
}

.engine-layout {
  align-items: stretch;
}

.engine-flow-stack {
  display: grid;
  gap: 0.6rem;
}

.engine-flow-step {
  border: 1px solid #d5e3ee;
  border-left: 5px solid #4f9fcb;
  border-radius: 10px;
  background: #fbfdff;
  padding: 0.62rem 0.68rem;
}

.engine-flow-step strong {
  display: block;
  margin-bottom: 0.15rem;
}

.engine-flow-step p {
  margin: 0;
}

.engine-guard-list {
  display: grid;
  gap: 0.55rem;
}

.engine-guard-item {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  border: 1px solid #d7e6f1;
  border-radius: 10px;
  background: #fbfdff;
  padding: 0.55rem 0.62rem;
}

.engine-sim-form {
  display: grid;
  gap: 0.7rem;
}

.engine-presets {
  margin-top: 0.2rem;
}

.engine-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.6rem;
}

.engine-result-item {
  border: 1px solid #d8e4ed;
  border-radius: 10px;
  background: #fbfdff;
  padding: 0.55rem 0.62rem;
}

.engine-result-item span {
  display: block;
  color: #5f6f7b;
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}

.engine-result-item strong {
  font-size: 0.92rem;
}

.engine-result-item-wide {
  grid-column: 1 / -1;
}

.engine-blocking-list .alert {
  margin: 0.35rem 0;
}

.flow-table-wrap {
  margin-top: 0.7rem;
  border: 1px solid #d9e2e8;
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #fff;
}

.flow-table-wrap table {
  min-width: 980px;
  margin: 0;
}

.invoice-list-table {
  min-width: 1200px;
}

.invoice-list-table th,
.invoice-list-table td {
  white-space: nowrap;
}

.invoice-list-table .flow-expand-row td {
  white-space: normal;
}

.provider-simple-table {
  min-width: 1020px;
}

.flow-table-wrap th {
  position: static;
}

.flow-expand-row td {
  background: #f8fcff;
  border-top: 0;
}

.flow-expand-content {
  padding: 0.75rem;
  border: 1px solid #d8e6f1;
  border-radius: 12px;
  background: #fff;
}

.flow-expand-content h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
}

.flow-inline-form {
  display: grid;
  gap: 0.7rem;
}

.row-active td {
  background: #eef8ff;
}

.btn.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.footer {
  max-width: 1280px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
  color: #6a7680;
}

@media (max-width: 900px) {
  .container {
    padding: 0 0.7rem;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 0.9rem;
  }

  .brand h1 {
    font-size: 1.05rem;
  }
}
