/* ── Base ─────────────────────────────────────────────────────────────────── */
:root {
  --navy:   #1a3c5e;
  --teal:   #2e7d8e;
  --light:  #f5f7fa;
  --border: #dee2e6;
}

body {
  background: var(--light);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #333;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar-rcm {
  background: linear-gradient(135deg, var(--navy) 0%, #24527a 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  padding: .75rem 1.5rem;
}

.navbar-rcm .navbar-brand {
  color: #fff !important;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: .02em;
}

.navbar-rcm .navbar-brand span {
  color: #7ec8d8;
}

.navbar-rcm .nav-link {
  color: rgba(255,255,255,.8) !important;
  font-size: .875rem;
}

.navbar-rcm .nav-link:hover { color: #fff !important; }

.navbar-rcm .badge-env {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: .7rem;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: .04em;
}

/* ── Page wrapper ─────────────────────────────────────────────────────────── */
.page-wrapper {
  padding: 1.5rem 2rem 3rem;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .25rem;
}

.page-subtitle {
  font-size: .875rem;
  color: #666;
  margin-bottom: 1.5rem;
}

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.breadcrumb {
  background: none;
  padding: 0;
  margin-bottom: .5rem;
  font-size: .8rem;
}

.breadcrumb-item a {
  color: var(--teal);
  text-decoration: none;
}

.breadcrumb-item a:hover { text-decoration: underline; }

/* ── Metric Cards ─────────────────────────────────────────────────────────── */
.metric-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
}

.metric-card .metric-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.metric-card .metric-icon.icon-red    { background: #fdecea; color: #c62828; }
.metric-card .metric-icon.icon-orange { background: #fff3e0; color: #e65100; }
.metric-card .metric-icon.icon-teal   { background: #e0f4f7; color: #00838f; }
.metric-card .metric-icon.icon-blue   { background: #e3f2fd; color: #1565c0; }
.metric-card .metric-icon.icon-purple { background: #f3e5f5; color: #6a1b9a; }

.metric-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #888;
  margin-bottom: 2px;
}

.metric-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.metric-sub {
  font-size: .78rem;
  color: #888;
  margin-top: 3px;
}

/* ── Section Card ─────────────────────────────────────────────────────────── */
.section-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden;
}

.section-card .card-header-rcm {
  background: var(--navy);
  color: #fff;
  padding: .85rem 1.25rem;
  font-weight: 600;
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.section-card .card-body-rcm {
  padding: 1.25rem;
}

/* ── Claims Table ─────────────────────────────────────────────────────────── */
.table-claims {
  font-size: .875rem;
  margin-bottom: 0;
}

.table-claims thead th {
  background: #f0f4f8;
  color: var(--navy);
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-top: none;
  border-bottom: 2px solid var(--border);
  padding: .75rem 1rem;
  white-space: nowrap;
}

.table-claims tbody tr {
  transition: background .15s;
}

.table-claims tbody tr:hover { background: #f8fafc; }

.table-claims tbody td {
  padding: .85rem 1rem;
  vertical-align: middle;
  border-color: #f0f0f0;
}

/* ── Priority Badges ──────────────────────────────────────────────────────── */
.priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: .9rem;
  color: #fff;
}

.priority-1 { background: #c62828; }
.priority-2 { background: #e65100; }
.priority-3 { background: #f9a825; color: #333; }
.priority-4 { background: #1565c0; }
.priority-5 { background: #757575; }

/* ── Denial Code Badges ───────────────────────────────────────────────────── */
.denial-badge {
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-carc50 { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.badge-carc4  { background: #ffe5cc; color: #7a3a00; border: 1px solid #fd7e14; }
.badge-carc97 { background: #d1ecf1; color: #0c5460; border: 1px solid #17a2b8; }

/* ── Action Buttons ───────────────────────────────────────────────────────── */
.btn-review {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: .8rem;
  font-weight: 600;
  transition: background .15s;
}

.btn-review:hover { background: #24527a; color: #fff; }

.btn-accept-sm {
  background: #fff;
  color: #555;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 11px;
  font-size: .78rem;
  transition: all .15s;
}

.btn-accept-sm:hover { background: #f8f9fa; border-color: #aaa; }

.btn-appeal-sm {
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 11px;
  font-size: .78rem;
  font-weight: 600;
  transition: background .15s;
}

.btn-appeal-sm:hover { background: #246577; }

/* ── Detail Info Grid ─────────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem 1.5rem;
}

.detail-row { display: flex; flex-direction: column; }
.detail-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #888; margin-bottom: 1px; }
.detail-value { font-size: .9rem; color: #222; font-weight: 500; }

.service-table { font-size: .82rem; }
.service-table thead th { background: #f0f4f8; font-size: .75rem; color: #555; font-weight: 600; }

/* ── Denial Alert Box ─────────────────────────────────────────────────────── */
.denial-alert {
  background: #fff8f0;
  border: 1px solid #ffc107;
  border-left: 4px solid #e65100;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.denial-alert .denial-code-large {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e65100;
}

/* ── Document Checklist ───────────────────────────────────────────────────── */
.doc-checklist-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: .5rem;
  background: #fff;
  transition: border-color .15s, background .15s;
}

.doc-checklist-item:hover { border-color: var(--teal); background: #f0fafb; }
.doc-checklist-item.selected { border-color: var(--teal); background: #e8f6f8; }

.doc-checklist-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.doc-name-link {
  color: var(--navy);
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  text-decoration: none;
  flex: 1;
}

.doc-name-link:hover { color: var(--teal); text-decoration: underline; }

.doc-type-badge {
  font-size: .7rem;
  color: #888;
  background: #f0f0f0;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── Appeal Letter Editor ─────────────────────────────────────────────────── */
.letter-section-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: .85rem;
}

.letter-section-header {
  background: #f0f4f8;
  padding: .5rem .9rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.letter-section-body {
  padding: .75rem 1rem;
  font-size: .85rem;
  line-height: 1.65;
  white-space: pre-wrap;
  min-height: 60px;
  outline: none;
  background: #fff;
  color: #222;
}

.letter-section-body:focus {
  outline: none;
  background: #fffef5;
  box-shadow: inset 0 0 0 2px #ffc10740;
}

.edit-hint {
  font-size: .7rem;
  color: #aaa;
  font-style: italic;
}

/* ── Document Preview Modal ───────────────────────────────────────────────── */
.doc-preview {
  font-size: .875rem;
  line-height: 1.6;
  color: #222;
  padding: .5rem;
}

.doc-section {
  margin-bottom: 1rem;
}

.doc-section-title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: .4rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 3px;
}

/* ── Submit Page ──────────────────────────────────────────────────────────── */
.submit-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.4rem 1.6rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  margin-bottom: 1.25rem;
}

.submit-section-title {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #888;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid #f0f0f0;
}

.copy-field {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  background: #f8fafc;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: .5rem;
}

.copy-field .copy-label { font-size: .72rem; color: #888; width: 160px; flex-shrink: 0; }
.copy-field .copy-value { font-size: .88rem; font-weight: 600; flex: 1; font-family: 'Courier New', monospace; }

.btn-copy {
  background: none;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: .72rem;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}

.btn-copy:hover { background: #e8f6f8; border-color: var(--teal); color: var(--teal); }
.btn-copy.copied { background: #e8f5e9; border-color: #4caf50; color: #388e3c; }

.portal-link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #e8f4fd;
  border: 1px solid #90caf9;
  border-radius: 8px;
  text-decoration: none;
  color: #1565c0;
  font-weight: 600;
  transition: background .15s;
}

.portal-link-card:hover { background: #d0e9fb; color: #0d47a1; }

.portal-link-card .portal-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.portal-link-card .portal-detail { font-size: .78rem; font-weight: 400; color: #555; }

/* ── Step Indicator ───────────────────────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1.5rem;
  font-size: .8rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  color: #aaa;
}

.step-item.active { color: var(--navy); font-weight: 600; }
.step-item.done   { color: var(--teal); }

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-item .step-num       { background: #e0e0e0; color: #666; }
.step-item.active .step-num { background: var(--navy); color: #fff; }
.step-item.done .step-num  { background: var(--teal); color: #fff; }
.step-divider { flex: 1; height: 1px; background: #ddd; max-width: 40px; }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast-container-custom {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
}

/* ── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #aaa;
}

.empty-state i { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 1rem; }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.text-navy  { color: var(--navy) !important; }
.text-teal  { color: var(--teal) !important; }
.bg-navy    { background: var(--navy) !important; }
.fw-600     { font-weight: 600; }
.fs-sm      { font-size: .85rem; }
.fs-xs      { font-size: .78rem; }

.divider { border-top: 1px solid var(--border); margin: 1.25rem 0; }

blockquote { font-style: italic; color: #555; border-left: 3px solid var(--teal); padding-left: 12px; }
