:root {
  --rfci-blue-dark: #0019ac;
  --rfci-blue: #005bff;
  --rfci-blue-soft: #eef4ff;
  --rfci-green: #6bf498;
  --rfci-green-dark: #1d8b53;
  --rfci-warm: #ffcb66;
  --rfci-red-soft: #fff0f0;
  --rfci-red: #df5b66;
  --rfci-ink: #14213d;
  --rfci-text: #263248;
  --rfci-muted: #5f6c86;
  --rfci-line: #d7def5;
  --rfci-line-strong: #c7d2f3;
  --rfci-surface: #ffffff;
  --rfci-surface-soft: #f7faff;
  --rfci-surface-soft-2: #eef4ff;
  --rfci-warning-bg: #fff7e6;
  --rfci-warning-line: #ffd67c;
  --rfci-danger-bg: #fff0f0;
  --rfci-danger-line: #f0b5b5;
  --rfci-success-bg: #effcf4;
  --rfci-success-line: #b5efc8;
  --rfci-radius: 5px;
  --rfci-shadow: 0 6px 18px rgba(0, 25, 172, 0.045);
  --rfci-shadow-hover: 0 10px 24px rgba(0, 25, 172, 0.08);
}

.rfci-card,
.rfci-stat-box,
.rfci-trend-card,
.rfci-chart-card,
.rfci-alert,
.rfci-quiz-result,
.rfci-table-wrap,
.rfci-filter-card,
.rfci-empty-state {
  box-sizing: border-box;
}

.rfci-card {
  position: relative;
  border: 1px solid var(--rfci-line);
  border-radius: var(--rfci-radius);
  padding: 20px;
  background: var(--rfci-surface);
  box-shadow: var(--rfci-shadow);
  margin: 22px 0;
  color: var(--rfci-text);
}

.rfci-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--rfci-blue-dark) 0%, var(--rfci-blue) 75%, var(--rfci-green) 100%);
  border-top-left-radius: var(--rfci-radius);
  border-top-right-radius: var(--rfci-radius);
}

.rfci-card h2,
.rfci-card h3,
.rfci-card h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--rfci-blue-dark);
  line-height: 1.22;
}

.rfci-card h3 {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.rfci-card h4 {
  font-size: 18px;
  font-weight: 900;
}

.rfci-card p:last-child,
.rfci-card ul:last-child,
.rfci-card ol:last-child {
  margin-bottom: 0;
}

.rfci-module-card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

.rfci-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.rfci-section-head-inline {
  margin-bottom: 18px;
}

.rfci-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  margin-bottom: 10px;
  border: 1px solid var(--rfci-line);
  border-radius: var(--rfci-radius);
  background: var(--rfci-blue-soft);
  color: var(--rfci-blue-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rfci-head-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.rfci-chip,
.rfci-inline-pill,
.rfci-bar-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: var(--rfci-radius);
  border: 1px solid var(--rfci-line);
  background: #fff;
  color: var(--rfci-blue-dark);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.rfci-chip-blue {
  background: var(--rfci-blue-soft);
}

.rfci-chip-green,
.rfci-inline-pill.is-accept {
  background: #effcf4;
  border-color: #bcefd0;
  color: var(--rfci-green-dark);
}

.rfci-chip-warm {
  background: var(--rfci-warning-bg);
  border-color: var(--rfci-warning-line);
  color: #946100;
}

.rfci-inline-pill.is-reject {
  background: var(--rfci-red-soft);
  border-color: #f2c4c7;
  color: #a43840;
}

.rfci-muted,
.rfci-stat-label,
.rfci-stat-foot,
.rfci-trend-kicker,
.rfci-chart-subtitle,
.rfci-chart-note,
.rfci-bar-label,
.rfci-mini-metric em {
  color: var(--rfci-muted);
}

.rfci-grid,
.rfci-stat-grid,
.rfci-filters,
.rfci-trend-cards {
  display: grid;
  gap: 14px;
}

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

.rfci-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  margin: 18px 0;
}

.rfci-stat-grid-compact {
  margin: 14px 0 0;
}

.rfci-trend-cards {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin: 16px 0 22px;
}

.rfci-form-wrap label,
.rfci-filters label,
.rfci-form label {
  display: block;
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 7px;
  color: var(--rfci-ink);
}

.rfci-form-wrap select,
.rfci-filters select,
.rfci-card input[type="datetime-local"],
.rfci-card input[type="number"],
.rfci-card textarea,
.rfci-card select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--rfci-line-strong);
  border-radius: var(--rfci-radius);
  background: #fff;
  color: var(--rfci-ink);
  box-sizing: border-box;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.rfci-form-wrap select:focus,
.rfci-filters select:focus,
.rfci-card input[type="datetime-local"]:focus,
.rfci-card input[type="number"]:focus,
.rfci-card textarea:focus,
.rfci-card select:focus {
  outline: none;
  border-color: var(--rfci-blue);
  box-shadow: 0 0 0 3px rgba(0, 91, 255, 0.12);
}

.rfci-filter-card {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 14px;
  border: 1px solid var(--rfci-line);
  border-radius: var(--rfci-radius);
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
  margin-bottom: 8px;
}

.rfci-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--rfci-blue-dark);
  border-radius: var(--rfci-radius);
  background: linear-gradient(180deg, var(--rfci-blue) 0%, var(--rfci-blue-dark) 100%);
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 91, 255, 0.16);
  transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.rfci-button:hover,
.rfci-button:focus {
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(0, 91, 255, 0.2);
  filter: brightness(1.02);
}

.rfci-button-secondary {
  background: #fff;
  color: var(--rfci-blue-dark) !important;
  border-color: var(--rfci-line-strong);
  box-shadow: none;
}

.rfci-button-secondary:hover,
.rfci-button-secondary:focus {
  box-shadow: 0 6px 14px rgba(0, 25, 172, 0.08);
}

.rfci-filter-submit {
  display: flex;
  align-items: end;
}

.rfci-filter-submit .rfci-button {
  width: 100%;
}

.rfci-stat-box,
.rfci-trend-card,
.rfci-chart-card,
.rfci-empty-state {
  border: 1px solid var(--rfci-line);
  border-radius: var(--rfci-radius);
  padding: 15px;
  background: linear-gradient(180deg, var(--rfci-surface-soft) 0%, #ffffff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  position: relative;
}

.rfci-stat-box::before,
.rfci-trend-card::before,
.rfci-chart-card::before,
.rfci-empty-state::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--rfci-green) 0%, var(--rfci-blue) 100%);
  border-top-left-radius: var(--rfci-radius);
  border-top-right-radius: var(--rfci-radius);
}

.rfci-stat-box.is-accept::before {
  background: linear-gradient(90deg, #b8efcb 0%, var(--rfci-green-dark) 100%);
}

.rfci-stat-box.is-reject::before {
  background: linear-gradient(90deg, #f7b2b8 0%, var(--rfci-red) 100%);
}

.rfci-stat-box.is-confidence::before {
  background: linear-gradient(90deg, #bfd0ff 0%, var(--rfci-blue-dark) 100%);
}

.rfci-stat-box strong,
.rfci-trend-card strong {
  display: block;
  margin-top: 6px;
  color: var(--rfci-blue-dark);
  font-size: 28px;
  line-height: 1.05;
  font-weight: 900;
}

.rfci-stat-label,
.rfci-trend-kicker,
.rfci-chart-subtitle,
.rfci-chart-note,
.rfci-stat-foot {
  font-size: 12px;
  line-height: 1.45;
}

.rfci-stat-foot {
  display: block;
  margin-top: 8px;
}

.rfci-trend-kicker {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--rfci-radius);
  background: var(--rfci-surface-soft-2);
  border: 1px solid var(--rfci-line);
  color: var(--rfci-blue-dark);
  font-weight: 800;
}

.rfci-trend-metric {
  display: block;
  margin-top: 8px;
  color: var(--rfci-ink);
  font-size: 13px;
  line-height: 1.45;
}

.rfci-mini-metrics {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.rfci-mini-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--rfci-ink);
  border-bottom: 1px dashed #e2e8fb;
  padding-bottom: 4px;
}

.rfci-mini-metric:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.rfci-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rfci-line);
  border-radius: var(--rfci-radius);
  background: #fff;
}

.rfci-table {
  width: 100%;
  border-collapse: collapse;
}

.rfci-table th,
.rfci-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e6ebf8;
  text-align: left;
  vertical-align: middle;
}

.rfci-table th {
  background: var(--rfci-surface-soft);
  color: var(--rfci-blue-dark);
  font-size: 13px;
  font-weight: 900;
}

.rfci-table tbody tr:nth-child(even) td {
  background: #fbfcff;
}

.rfci-table tbody tr:hover td {
  background: #f3f7ff;
}

.rfci-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
}

.rfci-checkbox input[type="checkbox"] {
  margin-top: 3px;
}

.rfci-alert {
  border: 1px solid var(--rfci-line);
  border-radius: var(--rfci-radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.rfci-alert-success {
  background: var(--rfci-success-bg);
  border-color: var(--rfci-success-line);
  color: #19613a;
}

.rfci-alert-warning {
  background: var(--rfci-warning-bg);
  border-color: var(--rfci-warning-line);
  color: #7d5600;
}

.rfci-alert-danger {
  background: var(--rfci-danger-bg);
  border-color: var(--rfci-danger-line);
  color: #8c2332;
}

.rfci-empty-state {
  margin: 12px 0 20px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
}

.rfci-empty-state strong {
  display: block;
  color: var(--rfci-blue-dark);
  margin-bottom: 6px;
}

.rfci-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.rfci-quiz-result {
  margin-top: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #f4f8ff 0%, #ffffff 100%);
  border: 1px solid #dbe6ff;
  border-radius: var(--rfci-radius);
}

.rfci-quiz-result.is-low {
  background: linear-gradient(180deg, #fff8eb 0%, #ffffff 100%);
  border-color: #ffd67c;
}

.rfci-quiz-result.is-high {
  background: linear-gradient(180deg, #effcf4 0%, #ffffff 100%);
  border-color: #bcefd0;
}

.rfci-quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.rfci-quiz-score {
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  color: var(--rfci-blue-dark);
  margin-bottom: 12px;
}

.rfci-chart-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.rfci-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--rfci-muted);
}

.rfci-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rfci-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.rfci-dot.is-accept { background: linear-gradient(180deg, #b8efcb 0%, var(--rfci-green-dark) 100%); }
.rfci-dot.is-reject { background: linear-gradient(180deg, #f7b2b8 0%, var(--rfci-red) 100%); }
.rfci-dot.is-docs { background: linear-gradient(180deg, #ffd67c 0%, #f5af18 100%); }

.rfci-bar-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 240px;
}

.rfci-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.rfci-bar-value {
  font-size: 12px;
  color: var(--rfci-blue-dark);
  font-weight: 800;
}

.rfci-bar-track {
  width: 100%;
  height: 180px;
  border-radius: var(--rfci-radius);
  background: linear-gradient(180deg, #e9effd 0%, #f7faff 100%);
  border: 1px solid #dbe4fb;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.rfci-bar-stack {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
}

.rfci-bar-segment {
  width: 100%;
  display: block;
}

.rfci-bar-segment.is-accept {
  background: linear-gradient(180deg, #b8efcb 0%, var(--rfci-green-dark) 100%);
}

.rfci-bar-segment.is-reject {
  background: linear-gradient(180deg, #f7b2b8 0%, var(--rfci-red) 100%);
}

.rfci-bar-segment.is-docs {
  background: linear-gradient(180deg, #ffe29d 0%, #f5b73a 100%);
}

.rfci-bar-empty {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.7);
}

.rfci-bar-label {
  font-size: 11px;
  text-align: center;
  line-height: 1.25;
}

.rfci-bank-card .rfci-button {
  min-width: 210px;
}

.rfci-bank-card-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e6ebf8;
}

@media (max-width: 900px) {
  .rfci-section-head,
  .rfci-chart-header {
    flex-direction: column;
  }

  .rfci-head-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .rfci-card {
    padding: 16px;
  }

  .rfci-card h3 {
    font-size: 21px;
  }

  .rfci-stat-box strong,
  .rfci-trend-card strong,
  .rfci-quiz-score {
    font-size: 24px;
  }

  .rfci-bar-chart {
    grid-template-columns: repeat(6, minmax(36px, 1fr));
    gap: 8px;
  }

  .rfci-table th,
  .rfci-table td {
    padding: 11px 12px;
  }

  .rfci-quiz-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
