/* Request for Approval (RFA) */

#panel-rfa {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.rfa-summary-row {
  margin-bottom: 0;
}

.stat-card--tasks {
  --stat-accent: var(--brand-orange);
  --stat-icon-bg: var(--brand-orange-light);
  --stat-icon-color: var(--brand-orange-dark);
}

#panel-rfa > .card.card--table {
  overflow: hidden;
}

#panel-rfa .card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  padding: 1rem 1.25rem;
}

#panel-rfa .card__head-main {
  flex: 1 1 18rem;
  min-width: 0;
}

#panel-rfa .card__head-main h2 {
  margin: 0 0 0.25rem;
}

#panel-rfa .card__hint {
  margin: 0 0 0.35rem;
  max-width: 42rem;
}

#panel-rfa .card__meta {
  display: block;
  margin-top: 0.25rem;
}

#panel-rfa .table-scroll {
  border-top: 1px solid var(--border);
}

.rfa-requests-table {
  table-layout: fixed;
  min-width: 56rem;
}

.rfa-requests-table thead th:nth-child(1),
.rfa-requests-table tbody td:nth-child(1) {
  width: 8.5rem;
}

.rfa-requests-table thead th:nth-child(2),
.rfa-requests-table tbody td:nth-child(2) {
  width: 16%;
}

.rfa-requests-table thead th:nth-child(3),
.rfa-requests-table tbody td:nth-child(3) {
  width: 11%;
}

.rfa-requests-table thead th:nth-child(4),
.rfa-requests-table tbody td:nth-child(4) {
  width: 10%;
}

.rfa-requests-table thead th:nth-child(5),
.rfa-requests-table tbody td:nth-child(5) {
  width: 8rem;
}

.rfa-requests-table thead th:nth-child(6),
.rfa-requests-table tbody td:nth-child(6) {
  width: 6.5rem;
}

.rfa-requests-table thead th:nth-child(7),
.rfa-requests-table tbody td:nth-child(7) {
  width: 9rem;
}

.rfa-requests-table thead th:nth-child(8),
.rfa-requests-table tbody td:nth-child(8) {
  width: 7rem;
}

.rfa-requests-table thead th:nth-child(9),
.rfa-requests-table tbody td:nth-child(9) {
  width: 5.5rem;
}

.rfa-requests-table tbody td {
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rfa-requests-table tbody td.col-actions {
  overflow: visible;
  white-space: nowrap;
}

.filter-bar--compact.rfa-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin: 0;
  padding: 0.85rem 1.25rem;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: var(--content-muted);
}

.filter-bar--compact.rfa-filters .filter-field--grow {
  flex: 1 1 16rem;
  min-width: 12rem;
}

.rfa-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 20rem;
}

.rfa-scope-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.rfa-scope-btn--active {
  background: var(--accent);
  color: var(--accent-fg, #fff);
  border-color: var(--accent);
}

.rfa-scope-btn--active:hover:not(:disabled) {
  background: var(--primary-hover);
  color: var(--accent-fg, #fff);
  border-color: var(--primary-hover);
}

.rfa-row {
  cursor: pointer;
}

.rfa-status--approved,
.rfa-status--paid {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.rfa-status--rejected {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.rfa-status--pending_approval,
.rfa-status--pending_finance,
.rfa-status--submitted {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.rfa-status--draft,
.rfa-status--returned {
  background: rgba(161, 161, 170, 0.2);
  color: var(--muted);
}

.rfa-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 1.15rem 1.25rem 1.25rem;
}

.rfa-config-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(32rem, calc(100vh - 14rem));
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--content-surface);
  overflow: hidden;
}

.rfa-config-card--wide {
  grid-column: 1 / -1;
  max-height: none;
}

.rfa-config-card__head {
  flex-shrink: 0;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--content-surface) 0%, var(--content-muted) 100%);
}

.rfa-config-card__head .btn {
  margin-top: 0.65rem;
}

.rfa-config-card__title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rfa-config-card__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.rfa-config-card__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.35rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 0.72rem;
  font-weight: 700;
}

.rfa-config-card__hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.rfa-config-card__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0.5rem 0.65rem;
}

.rfa-config-card__foot {
  flex-shrink: 0;
  padding: 0.85rem 1.1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--content-muted);
}

.rfa-config-card__foot-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.rfa-config-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rfa-config-list__empty {
  padding: 1.25rem 0.75rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--input-bg);
}

.rfa-config-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
}

.rfa-config-item__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rfa-config-item__code,
.rfa-config-item__meta {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--muted);
}

.rfa-config-item__badge {
  flex-shrink: 0;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(161, 161, 170, 0.2);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
}

.rfa-config-item--inactive {
  opacity: 0.72;
}

.rfa-config-add-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.rfa-config-add-form__label {
  font-size: 0.72rem;
  font-weight: 600;
}

.rfa-config-add-form__row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.rfa-config-add-form__row input {
  flex: 1 1 auto;
  min-width: 0;
}

.rfa-workflow-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rfa-workflow-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--input-bg);
}

.rfa-workflow-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.rfa-workflow-card__title {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.rfa-workflow-card__meta {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
}

.rfa-workflow-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex-shrink: 0;
}

.rfa-workflow-card__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.rfa-workflow-step-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--content-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.rfa-workflow-step-chip__num {
  color: var(--primary-hover);
}

.rfa-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rfa-form-error {
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.88rem;
}

.rfa-form-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
  margin: 0;
  background: var(--content-surface);
}

.rfa-form-section__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-hover);
  padding: 0 0.4rem;
}

.rfa-form-grid,
.rfa-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.rfa-form-grid label,
.rfa-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  min-width: 0;
}

.rfa-field > span {
  font-size: 0.78rem;
  font-weight: 600;
}

.rfa-field input,
.rfa-field textarea,
.rfa-field select,
.rfa-config-add-form__row input,
.rfa-wf-step-row input,
.rfa-wf-step-row select {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.62rem 0.78rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.rfa-field select,
.rfa-wf-step-row select {
  padding-right: 2.25rem;
}

.rfa-field textarea {
  min-height: 4.75rem;
  resize: vertical;
}

.rfa-field input:hover:not(:disabled):not(:focus),
.rfa-field textarea:hover:not(:disabled):not(:focus),
.rfa-field select:hover:not(:disabled):not(:focus),
.rfa-config-add-form__row input:hover:not(:disabled):not(:focus),
.rfa-wf-step-row input:hover:not(:disabled):not(:focus),
.rfa-wf-step-row select:hover:not(:disabled):not(:focus) {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background-color: var(--content-muted);
}

.rfa-field input:focus,
.rfa-field textarea:focus,
.rfa-field select:focus,
.rfa-config-add-form__row input:focus,
.rfa-wf-step-row input:focus,
.rfa-wf-step-row select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.rfa-field input::placeholder,
.rfa-field textarea::placeholder,
.rfa-config-add-form__row input::placeholder,
.rfa-wf-step-row input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.rfa-field input:disabled,
.rfa-field textarea:disabled,
.rfa-field select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  background: var(--content-muted);
}

.rfa-req {
  color: var(--danger);
  font-style: normal;
}

.rfa-form-span-2,
.rfa-detail-span {
  grid-column: 1 / -1;
}

/* RFA detail modal */
#rfa-detail-modal .rfa-detail-modal {
  display: flex;
  flex-direction: column;
  width: min(calc(100vw - 2rem), 60rem);
  max-height: min(48rem, calc(100vh - 2rem));
  overflow: hidden;
}

.rfa-detail-modal__head {
  align-items: flex-start;
  background: linear-gradient(180deg, var(--content-surface) 0%, var(--content-muted) 100%);
}

.rfa-detail-modal__head-main {
  flex: 1 1 auto;
  min-width: 0;
}

.rfa-detail-modal__code {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.rfa-detail-modal__head h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.rfa-detail-modal__status {
  margin-top: 0.55rem;
}

.rfa-detail-modal__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: var(--content-muted);
}

.rfa-detail-modal__body {
  padding: 1rem 1.15rem 0.5rem;
}

.rfa-detail-modal__foot {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--border);
  background: var(--content-surface);
}

#rfa-detail-delete-btn {
  margin-right: auto;
}

.rfa-detail-summary {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--content-surface) 0%, color-mix(in srgb, var(--primary) 5%, var(--content-surface)) 100%);
  box-shadow: var(--shadow);
}

.rfa-detail-summary__amount {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.rfa-detail-summary__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rfa-detail-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 0.72rem;
  font-weight: 700;
}

.rfa-detail-chip--muted {
  background: var(--content-muted);
  color: var(--muted);
}

.rfa-detail-section {
  margin-bottom: 1rem;
  padding: 0.95rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--content-surface);
}

.rfa-detail-section--last {
  margin-bottom: 0.35rem;
}

.rfa-detail-section__title {
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary-hover);
}

.rfa-detail-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.rfa-detail-section__head .rfa-detail-section__title {
  margin: 0;
}

.rfa-detail-section__count {
  flex-shrink: 0;
  min-width: 1.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
  background: var(--content-muted);
  border: 1px solid var(--border);
}

.rfa-detail-attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rfa-detail-attachment {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--content-surface);
}

.rfa-detail-attachment__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.rfa-detail-attachment__name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rfa-detail-attachment__meta {
  font-size: 0.74rem;
  color: var(--muted);
}

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

.rfa-detail-attachment__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--danger) 22%, var(--border));
  border-radius: 999px;
  background: var(--content-muted);
  color: var(--danger);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.rfa-detail-attachment__remove:hover {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.35);
  transform: translateY(-1px);
}

.rfa-detail-attachment__preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 999px;
  background: var(--content-muted);
  color: var(--primary-hover);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.rfa-detail-attachment__preview:hover {
  background: var(--primary-soft);
  border-color: rgba(249, 115, 22, 0.42);
  transform: translateY(-1px);
}

.rfa-detail-attachment__download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 999px;
  background: var(--content-muted);
  color: var(--primary-hover);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.rfa-detail-attachment__download:hover {
  background: var(--primary-soft);
  border-color: rgba(249, 115, 22, 0.42);
  transform: translateY(-1px);
}

.rfa-attachment-preview-modal .crm-modal__panel {
  max-width: min(960px, 96vw);
}

.rfa-attachment-preview-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 320px;
}

.rfa-attachment-preview-modal__frame {
  flex: 1;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--content-muted) 70%, transparent);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rfa-attachment-preview-modal__iframe {
  width: 100%;
  height: min(70vh, 640px);
  border: 0;
  background: #fff;
}

.rfa-attachment-preview-modal__img {
  max-width: 100%;
  max-height: min(70vh, 640px);
  object-fit: contain;
  display: block;
}

.rfa-attachment-preview-modal__fallback {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.rfa-attachment-preview-modal__fallback.hidden {
  display: none;
}


.rfa-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.rfa-detail-meta__item {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.rfa-detail-meta__item--wide {
  grid-column: 1 / -1;
}

.rfa-detail-meta__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.rfa-detail-meta__value {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.rfa-step-timeline,
.rfa-activity-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.rfa-step-card {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
}

.rfa-step-card--current {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: color-mix(in srgb, var(--primary) 7%, var(--content-surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.rfa-step-card--approved {
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.06);
}

.rfa-step-card--rejected {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.05);
}

.rfa-step-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  background: var(--content-muted);
  color: var(--primary-hover);
  font-size: 0.82rem;
  font-weight: 800;
}

.rfa-step-card--current .rfa-step-card__num {
  background: var(--primary);
  color: var(--accent-fg, #fff);
}

.rfa-step-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.rfa-step-card__head strong {
  font-size: 0.86rem;
}

.rfa-step-card__status {
  flex-shrink: 0;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(161, 161, 170, 0.18);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: capitalize;
}

.rfa-step-card__status--current,
.rfa-step-card__status--pending {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.rfa-step-card__status--approved {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.rfa-step-card__status--rejected {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.rfa-step-card__approver {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.rfa-activity-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.55rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.rfa-activity-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.rfa-activity-item__dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.45rem;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.rfa-activity-item__text {
  margin: 0 0 0.15rem;
  font-size: 0.84rem;
  line-height: 1.45;
}

.rfa-activity-item__time {
  font-size: 0.72rem;
  color: var(--muted);
}

.rfa-detail-empty {
  margin: 0;
  padding: 0.85rem 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

#rfa-detail-modal .rfa-approval-panel.crm-modal__body,
#rfa-detail-modal .rfa-edit-approver-panel.crm-modal__body {
  margin: 0 1.15rem 1rem;
  padding: 1rem 1.05rem 1.05rem;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 14px;
  background: var(--content-surface);
  box-shadow: var(--shadow);
}

.rfa-approval-panel__head {
  margin-bottom: 0.85rem;
}

.rfa-approval-panel__hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.rfa-approval-panel__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.rfa-field--span {
  grid-column: 1 / -1;
}

/* ——— RFA attachments ——— */
.rfa-attachments {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rfa-attachments__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.rfa-attachments__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.rfa-attachments__count {
  flex-shrink: 0;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--content-muted);
  border: 1px solid var(--border);
}

.rfa-attachments__count--full {
  color: #b45309;
  background: #fff7ed;
  border-color: rgba(249, 115, 22, 0.28);
}

.rfa-attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rfa-attachment-list__empty {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: var(--content-muted);
  color: var(--muted);
  font-size: 0.82rem;
}

.rfa-attachment-list__empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  color: var(--muted);
  background: var(--content-surface);
  border: 1px solid var(--border);
}

.rfa-attachment-list__empty-icon svg {
  width: 1rem;
  height: 1rem;
}

.rfa-attachment-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--content-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rfa-attachment-item:hover {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.rfa-attachment-item__icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 11px;
  flex-shrink: 0;
  color: var(--primary-hover);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--primary) 12%, var(--content-surface)),
    color-mix(in srgb, var(--primary) 4%, var(--content-muted))
  );
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.rfa-attachment-item__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.rfa-attachment-item__ext {
  position: absolute;
  right: -0.2rem;
  bottom: -0.2rem;
  min-width: 1.15rem;
  padding: 0.05rem 0.28rem;
  border-radius: 999px;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.25;
  color: #fff;
  background: var(--primary);
  border: 1.5px solid var(--content-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.rfa-attachment-item__icon--pdf {
  color: #dc2626;
  background: linear-gradient(145deg, #fef2f2, #fff7ed);
  border-color: rgba(220, 38, 38, 0.18);
}

.rfa-attachment-item__icon--pdf .rfa-attachment-item__ext {
  background: #dc2626;
}

.rfa-attachment-item__icon--word {
  color: #2563eb;
  background: linear-gradient(145deg, #eff6ff, #f8fafc);
  border-color: rgba(37, 99, 235, 0.18);
}

.rfa-attachment-item__icon--word .rfa-attachment-item__ext {
  background: #2563eb;
}

.rfa-attachment-item__icon--sheet {
  color: #16a34a;
  background: linear-gradient(145deg, #f0fdf4, #f8fafc);
  border-color: rgba(22, 163, 74, 0.18);
}

.rfa-attachment-item__icon--sheet .rfa-attachment-item__ext {
  background: #16a34a;
}

.rfa-attachment-item__icon--image {
  color: #7c3aed;
  background: linear-gradient(145deg, #f5f3ff, #faf5ff);
  border-color: rgba(124, 58, 237, 0.18);
}

.rfa-attachment-item__icon--image .rfa-attachment-item__ext {
  background: #7c3aed;
}

.rfa-attachment-item__icon--archive {
  color: #d97706;
  background: linear-gradient(145deg, #fffbeb, #fff7ed);
  border-color: rgba(217, 119, 6, 0.18);
}

.rfa-attachment-item__icon--archive .rfa-attachment-item__ext {
  background: #d97706;
}

.rfa-attachment-item__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.rfa-attachment-item__name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rfa-attachment-item__meta {
  font-size: 0.74rem;
  color: var(--muted);
}

.rfa-attachment-item__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.rfa-attachment-item__remove:hover {
  color: #b91c1c;
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.18);
}

.rfa-attachment-drop {
  position: relative;
  border: 1.5px dashed color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--primary) 7%, transparent), transparent 58%),
    var(--input-bg);
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.rfa-attachment-drop:hover {
  border-color: rgba(249, 115, 22, 0.45);
  background-color: var(--primary-soft);
}

.rfa-attachment-drop--active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--content-surface));
  box-shadow: 0 0 0 3px var(--focus-ring);
  transform: scale(1.005);
}

.rfa-attachment-drop--full {
  opacity: 0.62;
  pointer-events: none;
}

.rfa-payment-panel {
  margin-top: 0.5rem;
}

.rfa-payment-details__shared {
  margin-bottom: 0.35rem;
}

.rfa-payment-panel .rfa-form-grid {
  margin-top: 0;
}

.rfa-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.rfa-receipt-upload-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rfa-receipt-upload-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 4.5rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--content-surface, #fff);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.rfa-receipt-upload-btn:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: var(--primary-soft);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.rfa-receipt-upload-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  color: var(--primary-hover);
  background: color-mix(in srgb, var(--primary) 12%, var(--content-surface));
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
}

.rfa-receipt-upload-btn--camera .rfa-receipt-upload-btn__icon {
  color: #0369a1;
  background: color-mix(in srgb, #0ea5e9 12%, var(--content-surface));
  border-color: color-mix(in srgb, #0ea5e9 22%, var(--border));
}

.rfa-receipt-upload-btn__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.rfa-receipt-upload-btn__text strong {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

.rfa-receipt-upload-btn__text span {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}

.rfa-attachment-drop--receipts {
  margin-top: 0;
}

.rfa-attachment-drop__inner--compact {
  padding: 0.85rem 1rem;
  gap: 0.25rem;
  pointer-events: auto;
}

.rfa-attachment-drop__drag {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.rfa-receipt-upload-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.rfa-pop-mark-paid {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.rfa-detail-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--content-surface, #fff);
}

.rfa-detail-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.75rem 0.9rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.rfa-detail-tab:hover {
  color: var(--text);
}

.rfa-detail-tab--active {
  color: var(--primary-hover);
  border-bottom-color: var(--primary);
}

.rfa-pop-panel {
  padding: 1rem 1.25rem 1.25rem;
}

.rfa-pop-panel__hint {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.rfa-pop-panel__subhead {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.rfa-pop-message {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.rfa-pop-edit__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.rfa-pop-attachments {
  margin-top: 1.25rem;
}

.rfa-pop-readonly + .rfa-pop-edit,
.rfa-pop-edit + .rfa-pop-attachments {
  margin-top: 1rem;
}

.rfa-mobile-channel-fields {
  margin-top: 0.75rem;
}

.rfa-mobile-channel-fields .rfa-form-grid {
  margin-top: 0;
}

.rfa-camera-modal__panel {
  width: min(520px, calc(100vw - 2rem));
}

.rfa-camera-modal__body {
  padding-top: 0.5rem;
}

.rfa-camera-modal__viewport {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: #0f172a;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border);
}

.rfa-camera-modal__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.rfa-camera-modal__canvas {
  display: none;
}

.rfa-camera-modal__status {
  position: absolute;
  inset: auto 0 0 0;
  margin: 0;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  color: #f8fafc;
  text-align: center;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.82));
  pointer-events: none;
}

.rfa-camera-modal__status.hidden {
  display: none;
}

.rfa-camera-modal__error {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-size: 0.84rem;
  color: #991b1b;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.rfa-camera-modal__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.rfa-camera-modal__foot .btn-primary {
  margin-left: auto;
}

.rfa-attachment-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.rfa-attachment-drop__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1.15rem 1rem 1rem;
  text-align: center;
  pointer-events: none;
}

.rfa-attachment-drop__icon {
  position: relative;
  width: 4.25rem;
  height: 4.25rem;
  margin-bottom: 0.15rem;
}

.rfa-attachment-drop__icon-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 999px;
  color: var(--primary);
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--primary) 16%, #fff),
    color-mix(in srgb, var(--primary) 8%, var(--content-surface))
  );
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  box-shadow:
    0 10px 24px rgba(249, 115, 22, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
}

.rfa-attachment-drop__icon-badge {
  position: absolute;
  right: -0.15rem;
  bottom: -0.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-hover));
  border: 2px solid var(--content-surface);
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.28);
}

.rfa-attachment-drop:hover .rfa-attachment-drop__icon-main,
.rfa-attachment-drop--active .rfa-attachment-drop__icon-main {
  transform: translateY(-2px);
  box-shadow:
    0 14px 28px rgba(249, 115, 22, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.rfa-attachment-drop--active .rfa-attachment-drop__icon-badge {
  transform: scale(1.06);
}

.rfa-attachment-drop__text {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.88rem;
  color: var(--text);
}

.rfa-attachment-drop__browse {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 999px;
  background: var(--content-surface);
  color: var(--primary-hover);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.rfa-attachment-drop__browse-icon {
  flex-shrink: 0;
  color: var(--primary);
}

.rfa-attachment-drop__camera {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #111827);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.rfa-attachment-drop__camera:hover {
  background: var(--surface-elevated, #f8fafc);
  border-color: var(--accent, #2563eb);
  color: var(--accent, #2563eb);
}

.rfa-field--note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
  align-self: end;
}

.rfa-receipt-panel {
  border-top: 1px solid var(--border, #e5e7eb);
}

.rfa-receipt-panel__head {
  margin-bottom: 0.75rem;
}

.rfa-receipt-panel__hint {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
}

.rfa-receipt-panel__drop {
  margin-top: 0.75rem;
}

.rfa-resubmit-panel {
  border-top: 1px solid var(--border, #e5e7eb);
}

.rfa-resubmit-panel__head {
  margin-bottom: 0.75rem;
}

.rfa-resubmit-panel__hint {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
}

.rfa-resubmit-panel__drop {
  margin-top: 0.75rem;
}

#rfa-detail-complete-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.rfa-attachment-drop__browse:hover {
  background: var(--primary-soft);
  border-color: rgba(249, 115, 22, 0.42);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.12);
}

.rfa-attachment-drop__or {
  color: var(--muted);
  font-size: 0.82rem;
}

.rfa-attachment-drop__hint {
  margin: 0;
  max-width: 28rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
}

.rfa-approval-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.15rem;
}

.rfa-edit-approver-panel {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 1rem;
  margin-top: 0.25rem;
}

.rfa-edit-approver-panel__head {
  margin-bottom: 0.75rem;
}

.rfa-edit-approver-panel__form {
  margin-bottom: 0.75rem;
}

.rfa-approval-panel__actions .btn {
  min-height: 2.45rem;
  padding-inline: 1rem;
}

.rfa-action-btn--reject {
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.35);
}

.rfa-action-btn--reject:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.5);
  color: #991b1b;
}

.rfa-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.rfa-wf-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.rfa-wf-steps {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.rfa-wf-step-row {
  display: grid;
  grid-template-columns: 2rem minmax(11rem, 1.15fr) minmax(12rem, 1.35fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--content-surface);
}

.rfa-wf-step-row__num {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary-hover);
  text-align: center;
}

.rfa-wf-step-row select,
.rfa-wf-step-row input,
.rfa-wf-step-row .select-wrap,
.rfa-wf-step-row .custom-select {
  width: 100%;
  min-width: 0;
}

#rfa-create-modal .crm-modal__panel,
#rfa-workflow-modal .crm-modal__panel {
  max-height: min(48rem, calc(100vh - 4rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#rfa-create-modal .crm-modal__panel {
  width: min(calc(100vw - 2rem), 72rem);
}

#rfa-create-modal .rfa-form,
#rfa-workflow-modal #rfa-workflow-form {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
}

@media (min-width: 721px) {
  #rfa-workflow-modal .crm-modal__panel {
    width: min(calc(100vw - 2rem), 58rem);
  }
}

@media (max-width: 900px) {
  .rfa-summary-row {
    grid-template-columns: 1fr;
  }

  .rfa-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .filter-bar--compact.rfa-filters {
    grid-template-columns: 1fr;
  }

  .filter-bar--compact.rfa-filters .filter-field--grow,
  .filter-bar--compact.rfa-filters .filter-field--select {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .rfa-form-grid,
  .rfa-detail-grid,
  .rfa-config-grid,
  .rfa-detail-meta,
  .rfa-approval-panel__form {
    grid-template-columns: 1fr;
  }

  .rfa-receipt-upload-actions {
    grid-template-columns: 1fr;
  }

  .rfa-toolbar {
    justify-content: flex-start;
  }

  .rfa-wf-step-row {
    grid-template-columns: 2rem 1fr;
    grid-template-rows: auto auto auto;
  }

  .rfa-wf-step-row .select-wrap,
  .rfa-wf-step-row .custom-select,
  .rfa-wf-step-row input,
  .rfa-wf-step-row .rfa-wf-remove-step {
    grid-column: 2;
  }

  .rfa-attachment-drop__inner {
    padding: 1rem 0.75rem 0.85rem;
  }

  .rfa-attachment-drop__icon,
  .rfa-attachment-drop__icon-main {
    width: 3.65rem;
    height: 3.65rem;
  }

  .rfa-attachment-drop__icon-main svg {
    width: 24px;
    height: 24px;
  }
}

/* ——— RFA reports (Reports hub) ——— */
.rfa-reports-hero {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.rfa-reports-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(145deg, var(--content-surface), var(--content-muted));
  box-shadow: var(--shadow);
  min-width: 0;
}

.rfa-reports-kpi--accent {
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
  background: linear-gradient(145deg, color-mix(in srgb, var(--primary) 8%, var(--content-surface)), var(--content-muted));
}

.rfa-reports-kpi--success {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(145deg, rgba(34, 197, 94, 0.08), var(--content-muted));
}

.rfa-reports-kpi--pending {
  border-color: rgba(59, 130, 246, 0.28);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.08), var(--content-muted));
}

.rfa-reports-kpi--danger {
  border-color: rgba(239, 68, 68, 0.28);
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.08), var(--content-muted));
}

.rfa-reports-kpi__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.rfa-reports-kpi__value {
  font-size: 1.35rem;
  line-height: 1.15;
  color: var(--text);
}

.rfa-reports-kpi__hint {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.rfa-reports-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(16rem, 0.85fr);
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: start;
}

.rfa-reports-layout__main .analytics-grid {
  margin-bottom: 0;
}

.rfa-reports-side {
  position: sticky;
  top: 0.5rem;
}

.rfa-reports-requester-list {
  list-style: none;
  margin: 0;
  padding: 0.65rem 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.rfa-reports-requester-list__empty {
  padding: 1rem 0.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

.rfa-reports-requester {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--content-muted);
}

.rfa-reports-requester__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.rfa-reports-requester__body {
  min-width: 0;
}

.rfa-reports-requester__name {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rfa-reports-requester__meta {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
}

.rfa-reports-requester__count {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary-hover);
}

.rfa-reports-register {
  margin-bottom: 1rem;
}

.rfa-reports-table tbody tr {
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.rfa-reports-table tbody tr:hover {
  background: color-mix(in srgb, var(--primary) 6%, var(--content-surface));
}

.rfa-reports-table__request {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 10rem;
}

.rfa-reports-table__code {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--primary-hover);
}

.rfa-reports-table__title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.rfa-reports-table__person {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 8rem;
}

.rfa-reports-table__person strong {
  font-size: 0.82rem;
  font-weight: 600;
}

.rfa-reports-table__person span {
  font-size: 0.72rem;
  color: var(--muted);
}

.rfa-reports-table__money {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.rfa-reports-table__money--muted {
  color: var(--muted);
  font-weight: 500;
}

.rfa-reports-table__files {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--content-muted);
  color: var(--muted);
}

.rfa-reports-table__files--has {
  background: var(--primary-soft);
  color: var(--primary-hover);
}

.rfa-reports-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 1100px) {
  .rfa-reports-hero {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rfa-reports-layout {
    grid-template-columns: 1fr;
  }

  .rfa-reports-side {
    position: static;
  }
}

@media (max-width: 720px) {
  .rfa-reports-hero {
    grid-template-columns: 1fr 1fr;
  }

  .rfa-reports-split {
    grid-template-columns: 1fr;
  }
}

/* RFA reports — extended filters */
.filter-bar--rfa-reports {
  gap: 0.75rem;
}

.filter-bar__presets--status {
  flex-wrap: wrap;
}

.filter-preset--status {
  font-size: 0.8125rem;
  padding: 0.35rem 0.65rem;
}

.filter-bar__fields--rfa {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.65rem 0.75rem;
  flex: 1 1 auto;
  width: 100%;
}

.filter-bar__fields--rfa .filter-field--wide {
  grid-column: span 2;
}

.filter-bar__fields--rfa .filter-field--date {
  grid-column: span 2;
}

.filter-field--amount .filter-field__control input {
  min-width: 0;
}

.rfa-reports-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  padding-top: 0.15rem;
}

.rfa-reports-active-filters__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rfa-reports-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--surface-elevated, #f8fafc);
  color: var(--text-secondary, #475569);
  font-size: 0.8125rem;
  line-height: 1.3;
  cursor: pointer;
}

.rfa-reports-filter-chip:hover {
  border-color: var(--accent, #f97316);
  color: var(--accent, #f97316);
}

.rfa-reports-filter-chip span {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.65;
}

.rfa-wf-visibility {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  margin-top: 0.55rem;
}

.rfa-wf-visibility__opt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary, #0f172a);
  cursor: pointer;
}

.rfa-wf-visibility__opt input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary, #2563eb);
}

.rfa-wf-teams-wrap {
  margin-top: 0.85rem;
}

.rfa-wf-teams-wrap .rfa-field__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary, #475569);
  margin-bottom: 0.4rem;
}

.rfa-ms {
  position: relative;
  width: 100%;
}

.rfa-ms__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 10px;
  background: var(--content-surface, #fff);
  color: var(--text-primary, #0f172a);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rfa-ms__trigger:hover,
.rfa-ms__trigger[aria-expanded="true"] {
  border-color: var(--primary, #2563eb);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary, #2563eb) 18%, transparent);
}

.rfa-ms__trigger-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted, #64748b);
}

.rfa-ms__trigger-label.has-value {
  color: var(--text-primary, #0f172a);
  font-weight: 500;
}

.rfa-ms__chevron {
  flex-shrink: 0;
  opacity: 0.65;
}

.rfa-ms__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 14rem;
  overflow-y: auto;
  padding: 0.4rem;
  border: 1px solid var(--border, #d1d5db);
  border-radius: 12px;
  background: var(--content-surface, #fff);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.rfa-ms__option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
}

.rfa-ms__option:hover {
  background: var(--surface-elevated, #f8fafc);
}

.rfa-ms__option input {
  accent-color: var(--primary, #2563eb);
}

.rfa-ms__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.rfa-ms__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle, #e2e8f0);
  background: var(--surface-elevated, #f8fafc);
  color: var(--text-secondary, #475569);
  font-size: 0.78rem;
  font-weight: 500;
}

.rfa-ms__chip-remove {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  opacity: 0.7;
  padding: 0;
}

.rfa-ms__chip-remove:hover {
  opacity: 1;
  color: var(--danger, #dc2626);
}

@media (max-width: 900px) {
  .filter-bar__fields--rfa .filter-field--wide,
  .filter-bar__fields--rfa .filter-field--date {
    grid-column: span 1;
  }
}
