:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --ink: #162231;
  --muted: #526378;
  --line: #d4dce6;
  --accent: #0f5ca8;
  --accent-dark: #0a4480;
  --danger-bg: #fdecec;
  --danger-ink: #8f1d1d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.auth-card {
  max-width: 420px;
  margin: 64px auto;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2 { margin: 0 0 14px; }

.stack { display: flex; flex-direction: column; gap: 12px; }

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 600;
  color: var(--ink);
}

input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}

input:disabled { background: #edf1f6; color: var(--muted); }

button {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:hover { background: var(--accent-dark); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

.alert {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--danger-bg);
  color: var(--danger-ink);
  border: 1px solid #f5bcbc;
  font-weight: 500;
}

.essentials-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: #102a43;
  color: #fff;
}

.shell-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #2f80ed;
  font-weight: 700;
  font-size: 12px;
}

.shell-nav { flex: 1; display: flex; gap: 12px; }

.shell-region { display: flex; align-items: center; gap: 10px; }

.nav-trigger, .region-trigger {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.epoch-badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #d9e6f5;
}

.menu-wrap { position: relative; }

.dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.16);
  padding: 6px;
  z-index: 50;
}

.region-list {
  right: 0;
  left: auto;
  list-style: none;
  margin: 0;
}

.region-option-btn {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 7px 10px;
}

.region-option-btn:hover, .nav-app-item:hover {
  background: #eaf2fb;
  border-radius: 4px;
}

.nav-app-item {
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
}

.shell-status {
  padding: 6px 20px;
  font-size: 12px;
  color: var(--muted);
  background: #e9eff6;
  border-bottom: 1px solid var(--line);
}

.frame-host { flex: 1; display: flex; min-height: 0; }

.portal-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--bg);
}

.frame-body { padding: 20px; }

.frame-card, .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}

.claim-app { max-width: 1040px; margin: 0 auto; }

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

.context-pill {
  padding: 6px 10px;
  border-radius: 6px;
  background: #eaf2fb;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}

.status-banner {
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

.picker-grid, .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-group { display: flex; flex-direction: column; gap: 4px; }

.field-meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
}

.combobox { position: relative; }

.listbox {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(16, 42, 67, 0.14);
  z-index: 30;
}

.listbox li[role="option"] {
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.listbox li[role="option"]:hover,
.listbox li[role="option"][aria-selected="true"] { background: #eaf2fb; }

.listbox-empty {
  padding: 8px 10px;
  color: var(--muted);
  font-style: italic;
}

.provider-option-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.provider-npi {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
}

.product-bar { margin-top: 14px; display: flex; gap: 10px; }

.product-tab {
  background: #eaf2fb;
  border-color: var(--accent);
  color: var(--accent-dark);
}

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.hint { color: var(--muted); margin: 12px 0 0; }

.claims-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.claims-table th, .claims-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.claims-table th { background: #f0f4f8; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
