@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #002d74;
  --primary-light: #003e9c;
  --primary-rgb: 0, 45, 116;
  --secondary: #26ace2;
  --secondary-rgb: 38, 172, 226;
  --accent: #ff8200;
  --support: #7eadd6;
  --bg-app: #e1eff9;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --border: rgba(0, 45, 116, 0.12);
  --border-focus: #26ace2;
  --text-main: #001b45;
  --text-muted: #536b90;
  --text-inverse: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0, 45, 116, 0.05);
  --shadow: 0 10px 30px rgba(0, 45, 116, 0.06);
  --shadow-lg: 0 20px 40px rgba(0, 45, 116, 0.12);
  --radius: 12px;
  --radius-sm: 6px;
  --radius-lg: 20px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --state-bg: #cce0f0;
  --state-border: #a1c5e6;
  --state-hover-bg: #a1c5e6;
  --state-active-bg: linear-gradient(135deg, #002d74, #26ace2);
  --state-active-color: #ffffff;
  --state-inactive-bg: #d9e6f2;
  --state-inactive-color: #8faac4;
}

[data-theme="dark"] {
  --primary: #528ff2;
  --primary-light: #77a8f7;
  --primary-rgb: 82, 143, 242;
  --secondary: #26ace2;
  --secondary-rgb: 38, 172, 226;
  --accent: #ff8200;
  --support: #8da9c4;
  --bg-app: #0b132b;
  --bg-card: #1c2541;
  --bg-input: #2a3454;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: #26ace2;
  --text-main: #f1f5f9;
  --text-muted: #8da9c4;
  --text-inverse: #0b132b;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);

  --state-bg: #2a3454;
  --state-border: #3d4a75;
  --state-hover-bg: #3d4a75;
  --state-active-bg: linear-gradient(135deg, #002d74, #26ace2);
  --state-active-color: #ffffff;
  --state-inactive-bg: #1c2541;
  --state-inactive-color: #3d4a75;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  transition: background-color var(--transition), color var(--transition);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .brand-logo {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition), border-color var(--transition);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  background: linear-gradient(135deg, #002d74, #26ace2);
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 800;
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
  letter-spacing: 1px;
}

.brand-title-group h1 {
  font-size: 1.25rem;
  color: var(--primary);
  line-height: 1.1;
}

.brand-title-group p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cares-nav {
  display: flex;
  background-color: var(--bg-app);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border);
  gap: 4px;
}

.cares-nav-item {
  border: none;
  background: none;
  padding: 8px 20px;
  border-radius: 25px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cares-nav-item:hover {
  color: var(--primary);
}

.cares-nav-item.active {
  background-color: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.cares-nav-item .step-letter {
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  border-radius: 50%;
  background-color: var(--border);
  font-size: 0.75rem;
  font-weight: 800;
}

.cares-nav-item.active .step-letter {
  background-color: var(--primary);
  color: #ffffff;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  background-color: var(--border);
  color: var(--primary);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.main-content {
  flex: 1;
  padding: 1.5rem 2rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(320px, 350px) 1fr minmax(350px, 420px);
  gap: 1.5rem;
  align-items: start;
}

.card {
  background-color: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: background-color var(--transition), border-color var(--transition);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--bg-app);
  padding-bottom: 0.5rem;
}

.filter-group {
  margin-bottom: 1.25rem;
}

.filter-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.form-select, .form-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.form-select:focus, .form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(38, 172, 226, 0.15);
}

.autocomplete-container {
  position: relative;
}

.autocomplete-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  min-height: 40px;
  align-items: center;
}

.autocomplete-chips input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.9rem;
  flex: 1;
  min-width: 80px;
}

.chip {
  background-color: var(--primary);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-close {
  cursor: pointer;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.8);
}

.autocomplete-dropdown {
  position: absolute;
  top: 105%;
  left: 0;
  right: 0;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
}

.autocomplete-item:hover {
  background-color: rgba(38, 172, 226, 0.08);
  color: var(--primary);
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  background-color: var(--bg-app);
}

.checkbox-label-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background-color: var(--bg-card);
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.btn-clear {
  width: 100%;
  padding: 0.65rem;
  background: none;
  border: 1px dashed var(--accent);
  color: var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 10px;
}

.btn-clear:hover {
  background-color: var(--accent);
  color: #ffffff;
  border-style: solid;
}

.stats-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat-box {
  background-color: var(--bg-app);
  padding: 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border);
}

.stat-value {
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}

.map-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.map-legend {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.legend-color.matching { background: var(--state-active-bg); }
.legend-color.available { background-color: var(--bg-card); }
.legend-color.empty { background-color: var(--state-inactive-bg); }

.state-grid-wrapper {
  overflow-x: auto;
  padding: 10px 0;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 6px;
  min-width: 580px;
  aspect-ratio: 12 / 8;
}

.state-tile {
  grid-row: var(--row);
  grid-column: var(--col);
  aspect-ratio: 1 / 1;
  background-color: var(--bg-card);
  border: 1px solid var(--state-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, background 0.3s;
}

.state-tile:hover {
  transform: scale(1.1);
  z-index: 10;
  border-color: var(--primary);
}

.state-tile.active-state {
  box-shadow: 0 0 0 2px var(--accent);
}

.state-tile.matching {
  background: var(--state-active-bg);
  border-color: transparent;
}

.state-tile.matching .state-abbr {
  color: var(--state-active-color);
  font-weight: 800;
}

.state-tile.matching .state-badge {
  background-color: rgba(255, 255, 255, 0.25);
  color: var(--state-active-color);
}

.state-tile.inactive {
  background-color: var(--state-inactive-bg);
  border-color: var(--border);
  cursor: not-allowed;
}

.state-tile.inactive .state-abbr { color: var(--state-inactive-color); }
.state-tile.inactive .state-badge { display: none; }

.state-abbr {
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.state-badge {
  font-size: 0.6rem;
  font-weight: 800;
  background-color: var(--bg-app);
  color: var(--text-muted);
  padding: 1px 4px;
  border-radius: 4px;
  margin-top: 2px;
}

.state-tile-tooltip {
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background-color: #001b45;
  color: #f1f5f9;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 200;
}

.state-tile:hover .state-tile-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.details-panel {
  display: flex;
  flex-direction: column;
}

.state-detail-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.state-detail-pin {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent);
}

.accordion-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
}

.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
}

.accordion-header {
  padding: 10px 14px;
  background-color: var(--bg-app);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
}

.accordion-header.active {
  background-color: rgba(38, 172, 226, 0.05);
  color: var(--primary);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}

.accordion-content-inner {
  padding: 12px 14px;
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.product-badge.aca { background-color: rgba(220, 38, 38, 0.1); color: #dc2626; }
.product-badge.ancillary { background-color: rgba(217, 119, 6, 0.1); color: #d97706; }
.product-badge.life { background-color: rgba(16, 185, 129, 0.1); color: #10b981; }
.product-badge.medicare-advantage { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.product-badge.medicare-supplement { background-color: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.product-badge.pdp { background-color: rgba(236, 72, 153, 0.1); color: #ec4899; }

.table-header-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.table-search-box {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
}

.table-search-box input {
  border: none;
  background: transparent;
  color: var(--text-main);
  outline: none;
}

.btn-action {
  background-color: var(--accent);
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.btn-action:hover {
  background-color: #e67300;
}

.btn-secondary {
  background-color: var(--bg-app);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.table-wrapper {
  overflow-x: auto;
  max-height: 400px;
  border: 1px solid var(--border);
}

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

th {
  background-color: var(--bg-app);
  font-family: 'Poppins', sans-serif;
  color: var(--primary);
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.pagination-controls {
  display: flex;
  gap: 6px;
}

.pagination-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  background-color: var(--bg-card);
  cursor: pointer;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.compare-selector-row {
  display: flex;
  gap: 15px;
  align-items: center;
  background-color: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius);
}

.compare-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.compare-matrix-table {
  width: 100%;
}

.matrix-check { color: #10b981; font-weight: 800; }
.matrix-cross { color: var(--accent); font-weight: 800; }

.assist-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

.product-guide-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-guide-card {
  padding: 12px 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.product-guide-card.active {
  border-left: 4px solid var(--secondary);
}

.compliance-box {
  background-color: rgba(0, 45, 116, 0.03);
  border-left: 4px solid var(--primary);
  padding: 1rem;
}

.auditor-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
}

.audit-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}

.status-bullet-green {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #10b981;
}

.status-bullet-orange {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--accent);
}

.enroll-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.5rem;
}

.template-box {
  background-color: var(--bg-app);
  border: 1px solid var(--border);
  padding: 1rem;
  font-family: monospace;
  white-space: pre-wrap;
  max-height: 350px;
  overflow-y: auto;
}

.btn-copy-template {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  padding: 4px 8px;
}

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

.faq-item {
  border: 1px solid var(--border);
  padding: 1rem;
  background-color: var(--bg-card);
}

.faq-question {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--primary);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 27, 69, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 90%;
  max-width: 460px;
  position: relative;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.data-source-status {
  background-color: var(--bg-app);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
}

.upload-dropzone {
  border: 2px dashed var(--support);
  background-color: rgba(126, 173, 214, 0.05);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--secondary);
  background-color: rgba(38, 172, 226, 0.08);
}

@media (max-width: 1200px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .details-panel { order: 3; }
}

@media (max-width: 900px) {
  header { flex-direction: column; gap: 15px; }
  .compare-container, .assist-layout, .auditor-layout, .enroll-layout { grid-template-columns: 1fr; }
}
