/* ==========================================================
   Scheme Amount Breakdown Modal (#schemeBreakdownModal)
   ========================================================== */

/* clickable amount in scheme table */
.scheme-amount-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-light, #eef2ff);
  color: var(--primary, #6366f1);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.scheme-amount-link i {
  font-size: 0.8em;
  opacity: 0.75;
}
.scheme-amount-link:hover,
.scheme-amount-link:focus-visible {
  background: var(--primary, #6366f1);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  outline: none;
}

/* modal shell */
.sbm-content {
  border: none;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.sbm-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 45%, #8b5cf6 100%);
  overflow: hidden;
}
.sbm-header::before,
.sbm-header::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.sbm-header::before { width: 180px; height: 180px; right: -50px; top: -90px; }
.sbm-header::after  { width: 110px; height: 110px; right: 90px; bottom: -70px; }

.sbm-header-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 1.35rem;
}
.sbm-header-text { min-width: 0; flex: 1; position: relative; z-index: 1; }
.sbm-eyebrow {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}
.sbm-title {
  margin: 2px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: #fff;
}
.sbm-close {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  transition: background 0.2s ease, transform 0.2s ease;
}
.sbm-close:hover { background: rgba(255, 255, 255, 0.32); transform: rotate(90deg); }

.sbm-body {
  padding: 22px 24px 24px;
  background: #f8fafc;
}

/* fee type chip */
.sbm-type-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.sbm-type-label {
  font-size: 0.78rem;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sbm-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid #c7d2fe;
}

/* private fees note */
.sbm-note {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  color: #78350f;
  font-size: 0.88rem;
  line-height: 1.55;
}
.sbm-note > i { font-size: 1.15rem; color: #d97706; margin-top: 1px; }
.sbm-note strong { color: #92400e; }

/* section titles */
.sbm-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text, #1e293b);
}
.sbm-section-title i { color: var(--primary, #6366f1); }
.sbm-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted, #64748b);
}

/* component list */
.sbm-components {
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
}
.sbm-comp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}
.sbm-comp-row:hover { background: #f8faff; }
.sbm-comp-index {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 0.75rem;
  font-weight: 700;
}
.sbm-comp-name { flex: 1; min-width: 0; color: #334155; font-size: 0.9rem; }
.sbm-comp-amount { font-weight: 600; color: #0f172a; white-space: nowrap; }
.sbm-comp-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
}

/* summary tiles */
.sbm-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.sbm-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sbm-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06); }
.sbm-tile-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 1.05rem;
}
.sbm-tile-icon.is-scheme      { background: #eef2ff; color: #4f46e5; }
.sbm-tile-icon.is-maintenance { background: #ecfdf5; color: #059669; }
.sbm-tile-icon.is-disability  { background: #fff7ed; color: #ea580c; }
.sbm-tile-label { display: block; font-size: 0.75rem; color: var(--muted, #64748b); }
.sbm-tile-value { display: block; font-size: 1rem; font-weight: 700; color: #0f172a; }

.sbm-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.28);
}
.sbm-total-label { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.sbm-total-label i { font-size: 1.3rem; }
.sbm-total-value { font-size: 1.45rem; font-weight: 700; letter-spacing: 0.01em; }

/* states */
.sbm-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 12px;
  text-align: center;
  color: var(--muted, #64748b);
}
.sbm-state i { font-size: 2rem; }
.sbm-state.is-error i { color: #dc2626; }
.sbm-state.is-warning i { color: #d97706; }

.sbm-skeleton {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: sbm-shimmer 1.2s infinite;
  margin-bottom: 12px;
}
.sbm-skeleton.lg { height: 56px; border-radius: 12px; }
@keyframes sbm-shimmer { to { background-position: -200% 0; } }

@media (max-width: 576px) {
  .sbm-header { padding: 16px; }
  .sbm-body { padding: 16px; }
  .sbm-summary { grid-template-columns: 1fr; }
  .sbm-total-value { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sbm-skeleton { animation: none; }
  .sbm-tile, .sbm-close, .scheme-amount-link { transition: none; }
}
