/* ============================================
   PARTNER PROGRAM ACCESS MANAGEMENT - FINAL
   Complete styles with UI cleanup
   ============================================ */

:root {
  --deep-cyprus-900: #1c3738;
  --deep-cyprus-800: #224c4d;
  --gray-950: #282622;
  --gray-700: #716c5d;
  --gray-600: #87826f;
  --gray-400: #a8a595;
  --gray-300: #c0c0b1;
  --gray-200: #d9d8cf;
  --gray-100: #ecece8;
  --gray-50: #f7f7f5;
  --zomp-700: #216456;
  --zomp-500: #32a287;
  --zomp-200: #a9e6d2;
  --zomp-50: #f2fbf8;
  --indigo-700: #4338ca;
  --indigo-200: #c7d2fe;
  --indigo-50: #eef2ff;
  --sunglow-700: #b74b06;
  --sunglow-400: #ffb720;
  --sunglow-200: #ffe288;
  --sunglow-100: #fff0c7;
  --sunglow-50: #fffaeb;
  --electric-lime: #c7ff28;
}

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

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--gray-950);
  line-height: 1.5;
}

/* Top Bar */
.top-bar {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.top-bar-left { display: flex; align-items: center; gap: 40px; }
.top-bar-right { display: flex; align-items: center; gap: 16px; }

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  background: var(--deep-cyprus-900);
  border-radius: 6px;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-950);
}

.nav-menu {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
}

.nav-link:hover { background: var(--gray-50); color: var(--gray-950); }
.nav-link.active { background: var(--gray-100); color: var(--gray-950); font-weight: 600; }

.avatar {
  width: 32px;
  height: 32px;
  background: var(--gray-300);
  border-radius: 50%;
}

.topbar-button {
  padding: 8px 16px;
  font-size: 14px;
}

/* Page Body */
.page-body {
  padding: 32px 0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.header-text h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 15px;
  color: var(--gray-600);
}

.view-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-switcher-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
}

.view-tabs {
  display: flex;
  gap: 4px;
  background: white;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.view-tab {
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.view-tab:hover { background: var(--gray-50); color: var(--gray-950); }
.view-tab.active { background: var(--gray-950); color: white; }

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.btn-primary {
  background: var(--electric-lime);
  color: var(--gray-950);
}

.btn-primary:hover { background: #d4ff3d; }

.btn-secondary {
  background: white;
  color: var(--gray-950);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover { background: var(--gray-50); }

.btn-danger {
  background: var(--sunglow-700);
  color: white;
}

.btn-danger:hover { background: var(--sunglow-400); }

.btn-edit {
  padding: 7px 14px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-edit:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 20px;
  transition: all 0.15s;
}

.btn-back:hover { background: var(--gray-200); }

/* Partner List */
.partner-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.partner-row {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px 12px 0 0;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.partner-row:hover { border-color: var(--gray-300); }
.partner-row.expanded { border-radius: 12px 12px 0 0; margin-bottom: 0; }

.partner-chevron {
  font-size: 11px;
  color: var(--gray-400);
  transition: transform 0.2s;
  display: inline-block;
}

.partner-chevron.open { transform: rotate(90deg); }

.partner-info { flex: 1; }

.partner-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 2px;
}

.partner-meta {
  font-size: 14px;
  color: var(--gray-600);
}

/* Expanded Content */
.partner-expanded {
  background: white;
  border: 1px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 12px 12px;
  margin-bottom: 16px;
}

/* Tabs */
.expanded-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-100);
  padding: 0 24px;
}

.tab {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}

.tab:hover { color: var(--gray-950); }
.tab.active {
  color: var(--gray-950);
  border-bottom-color: var(--gray-950);
  font-weight: 600;
}

.tab-count {
  margin-left: 4px;
  color: var(--gray-600);
  font-weight: 500;
}

.tab.active .tab-count { color: var(--gray-950); }

.tab-content {
  display: none;
  padding: 24px;
}

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

/* Agency Search */
.agency-search {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 16px;
}

.agency-search:focus {
  outline: none;
  border-color: var(--deep-cyprus-800);
}

/* Select All Row */
.select-all-row {
  padding: 12px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-all-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.select-all-label {
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

/* Agency Rows */
.agencies-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agency-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  transition: all 0.15s;
}

.agency-row:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.agency-row.selected {
  background: var(--zomp-50);
  border-color: var(--zomp-200);
}

.agency-row.has-override {
  border-left: 3px solid var(--sunglow-400);
}

.agency-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.agency-name {
  font-size: 15px;
  font-weight: 500;
  flex: 1;
}

.agency-pills {
  display: flex;
  gap: 6px;
}

.pill, .program-pill {
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.program-pill.has-restriction {
  font-weight: 500;
}

/* Pill tooltip on hover */
.pill-tooltip-wrap {
  position: relative;
  cursor: pointer;
  transition: all 0.15s;
}

.pill-tooltip-wrap:hover {
  filter: brightness(0.95);
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

.pill-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-950);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: pre-line;
  z-index: 100;
  min-width: 160px;
  max-width: 280px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  pointer-events: none;
}

.pill-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--gray-950);
}

.pill-tooltip-wrap:hover .pill-tooltip {
  display: block;
}

.pill-evanston { background: var(--zomp-50); color: var(--zomp-700); border: 1px solid var(--zomp-200); }
.pill-starstone { background: var(--indigo-50); color: var(--indigo-700); border: 1px solid var(--indigo-200); }
.pill-hadron { background: var(--sunglow-50); color: var(--sunglow-700); border: 1px solid var(--sunglow-200); }

/* All Selected Message */
.all-selected-message {
  padding: 32px 24px;
  background: var(--zomp-50);
  border: 2px solid var(--zomp-200);
  border-radius: 12px;
  text-align: center;
  margin-bottom: 16px;
}

.all-selected-message h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.all-selected-message p {
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 16px;
}

/* Bulk Actions Bar */
.bulk-actions-bar-inline {
  padding: 16px 20px;
  background: var(--deep-cyprus-900);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideIn 0.25s ease;
  position: sticky;
  bottom: 16px;
  margin: 16px 0;
  z-index: 10;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

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

.bulk-selected-count {
  font-size: 15px;
  font-weight: 600;
}

.bulk-actions-buttons {
  display: flex;
  gap: 10px;
}

.bulk-actions-buttons .btn-secondary {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: white;
}

.bulk-actions-buttons .btn-secondary:hover {
  background: rgba(255,255,255,0.15);
}

/* Product Lines */
.product-lines-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-line-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
}

.product-line-card.disabled {
  opacity: 0.6;
}

.product-line-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.product-line-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-line-title h3 {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.carrier-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-evanston { background: var(--zomp-50); color: var(--zomp-700); }
.badge-starstone { background: var(--indigo-50); color: var(--indigo-700); }
.badge-hadron { background: var(--sunglow-50); color: var(--sunglow-700); }

.status-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-enabled { background: var(--zomp-50); color: var(--zomp-700); }
.status-disabled { background: var(--gray-100); color: var(--gray-600); }

.product-line-programs {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 12px;
}

.product-line-states {
  margin-bottom: 12px;
  font-size: 14px;
}

.states-summary {
  color: var(--gray-700);
}

.states-warning {
  margin-left: 12px;
  color: var(--sunglow-700);
  font-weight: 500;
}

.product-line-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-expand-programs {
  padding: 7px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-expand-programs:hover {
  background: var(--gray-100);
}

.btn-expand-programs.expanded {
  background: var(--gray-950);
  color: white;
  border-color: var(--gray-950);
}

/* Programs Drilldown */
.programs-drilldown {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}

.programs-drilldown.active {
  display: block;
}

.programs-drilldown-header {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  margin-bottom: 12px;
}

.program-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 8px;
}

.program-item.has-override {
  border-left: 3px solid var(--sunglow-400);
}

.program-info h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.program-states {
  font-size: 13px;
  color: var(--gray-600);
}

.program-states.override {
  color: var(--sunglow-700);
  font-weight: 500;
}

.btn-edit-program {
  padding: 6px 12px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-edit-program:hover {
  background: var(--gray-50);
}

/* State Restrictions */
.state-restriction-item {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.restriction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.restriction-header h4 {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.restriction-summary {
  font-size: 14px;
  color: var(--gray-600);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,55,56,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.modal-overlay[style*="display: flex"] {
  display: flex;
}

.modal-dialog {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-text {
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Side Panels */
.side-panel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}

.side-panel[style*="display: flex"] {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.side-panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28,55,56,0.5);
}

.side-panel-sheet {
  position: relative;
  width: 560px;
  max-width: 90vw;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.25s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.side-panel-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  background: var(--gray-100);
  border: none;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.side-panel-close:hover {
  background: var(--gray-200);
}

.side-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.side-panel-header {
  margin-bottom: 24px;
}

.side-panel-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.side-panel-subtitle {
  font-size: 14px;
  color: var(--gray-600);
}

.side-panel-footer {
  padding: 20px 32px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.config-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.modal-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
  margin-bottom: 12px;
  display: block;
}

.modal-help {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* Bulk Program List */
.bulk-program-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bulk-program-row {
  padding: 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

.bulk-program-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.bulk-program-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* State Mode Options */
.state-mode-section {
  margin-bottom: 24px;
}

.mode-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.radio-option:hover {
  background: white;
  border-color: var(--gray-300);
}

.radio-option input[type="radio"] {
  margin-top: 2px;
  cursor: pointer;
}

.radio-option > div {
  flex: 1;
}

.radio-option-label {
  font-size: 14px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.radio-option-help {
  font-size: 13px;
  color: var(--gray-600);
  display: block;
}

/* State Selection */
.state-selection-section {
  margin-top: 24px;
}

.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.state-checkbox {
  padding: 10px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.state-checkbox:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.state-checkbox.selected {
  background: var(--zomp-500);
  color: white;
  border-color: var(--zomp-500);
}

/* Success Message */
.success-message {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--zomp-700);
  color: white;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideUp 0.25s ease;
  z-index: 400;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Programs View */
.program-group {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 12px;
}

.program-group-header {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}

.program-group-header:hover {
  background: var(--gray-50);
}

.program-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
}

.program-chevron {
  font-size: 11px;
  color: var(--gray-400);
  transition: transform 0.2s;
  display: inline-block;
}

.program-chevron.open {
  transform: rotate(90deg);
}

.partner-count {
  font-size: 14px;
  color: var(--gray-600);
}

.program-group-body {
  padding: 12px 20px 20px;
  border-top: 1px solid var(--gray-100);
}

.partner-availability-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 8px;
}

.partner-availability-item:last-child {
  margin-bottom: 0;
}

.partner-availability-item .partner-name {
  font-size: 14px;
  font-weight: 600;
}

/* States View */
.state-group {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 12px;
}

.state-group-header {
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}

.state-group-header:hover {
  background: var(--gray-50);
}

.state-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 600;
}

.state-chevron {
  font-size: 11px;
  color: var(--gray-400);
  transition: transform 0.2s;
  display: inline-block;
}

.state-chevron.open {
  transform: rotate(90deg);
}

.state-name {
  font-size: 16px;
  font-weight: 600;
}

.state-abbrev {
  font-size: 14px;
  color: var(--gray-600);
  font-weight: 500;
}

.programs-count {
  font-size: 14px;
  color: var(--gray-600);
}

.state-group-body {
  padding: 12px 20px 20px;
  border-top: 1px solid var(--gray-100);
}

.program-availability-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 8px;
}

.program-availability-item:last-child {
  margin-bottom: 0;
}

.program-availability-item .program-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.from-partner {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 500;
}

/* Bulk Program Configuration */
.bulk-program-row.selected {
  background: var(--zomp-50);
  border-color: var(--zomp-200);
}

/* Grouped Program Sections */
.program-group-section {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}

.program-group-section.has-selection {
  border-color: var(--zomp-300);
}

.program-group-header-row {
  padding: 12px;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.program-group-chevron {
  cursor: pointer;
  font-size: 11px;
  color: var(--gray-400);
  padding: 4px 8px;
  transition: transform 0.2s;
  user-select: none;
}

.program-group-chevron.open {
  transform: rotate(90deg);
}

.program-group-children {
  border-top: 1px solid var(--gray-200);
  background: white;
}

.program-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 14px;
}

.program-group-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.program-group-name {
  font-weight: 600;
}

.program-group-count {
  color: var(--gray-500);
  font-weight: 400;
  font-size: 13px;
}

.program-child-row {
  padding: 10px 12px 10px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
}

.program-child-row:last-child {
  border-bottom: none;
}

.program-child-row.selected {
  background: var(--zomp-50);
}

.program-child-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  flex: 1;
}

.program-child-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Confirmation Modal */
.confirm-dialog {
  max-width: 480px;
}

.confirm-section {
  margin-bottom: 16px;
}

.confirm-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-bottom: 6px;
}

.confirm-programs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.confirm-program-item {
  padding: 4px 10px;
  background: var(--gray-100);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}

.confirm-states {
  font-size: 14px;
  color: var(--gray-700);
}

.confirm-agencies {
  font-size: 13px;
  color: var(--gray-600);
}

.bulk-program-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.bulk-program-label {
  flex: 1;
}

.restriction-status {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 400;
  white-space: nowrap;
}

.restriction-status.has-restriction {
  color: var(--sunglow-700);
  font-weight: 500;
}

.btn-configure-bulk {
  padding: 6px 12px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-configure-bulk:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.bulk-program-config-summary {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--sunglow-50);
  border: 1px solid var(--sunglow-200);
  border-radius: 6px;
  font-size: 13px;
  color: var(--sunglow-700);
  font-weight: 500;
}

/* Region Cards */
.regions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.region-card {
  padding: 12px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.region-card:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  transform: translateY(-1px);
}

.region-card.risk-profile {
  background: var(--sunglow-50);
  border-color: var(--sunglow-200);
}

.region-card.risk-profile:hover {
  background: var(--sunglow-100);
}

.region-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--gray-950);
}

.region-states {
  font-size: 12px;
  color: var(--gray-600);
}

/* Exclusion Summary */
.exclusion-summary {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--sunglow-50);
  border: 1px solid var(--sunglow-200);
  border-radius: 8px;
  font-size: 14px;
  color: var(--sunglow-700);
  font-weight: 500;
}

/* ============================================
   COPY RESTRICTIONS SCREEN
   ============================================ */

/* Apply Success */
.apply-success {
  text-align: center;
  padding: 24px;
  background: var(--zomp-50);
  border: 2px solid var(--zomp-200);
  border-radius: 12px;
  margin-bottom: 24px;
}

.success-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 12px;
}

.apply-success h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--gray-950);
}

.apply-success p {
  font-size: 14px;
  color: var(--gray-700);
}

/* Copy Restrictions Section */
.copy-restrictions-section {
  margin-bottom: 24px;
}

.restriction-display {
  padding: 12px 16px;
  background: var(--sunglow-50);
  border: 2px solid var(--sunglow-200);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sunglow-700);
  text-align: center;
  margin-bottom: 20px;
}

/* Copy Targets List */
.copy-targets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}

.copy-target-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-target-row:hover {
  background: white;
  border-color: var(--gray-300);
}

.copy-target-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Select All Copy */
.select-all-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: white;
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.select-all-copy:hover {
  border-color: var(--gray-400);
  background: var(--gray-50);
}

.select-all-copy input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Configure Selected Button */
.btn-configure-selected {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid var(--deep-cyprus-900);
  background: white;
  color: var(--deep-cyprus-900);
}

.btn-configure-selected:hover:not(.disabled) {
  background: var(--deep-cyprus-900);
  color: white;
}

.btn-configure-selected.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--gray-300);
  color: var(--gray-400);
}

/* Configuring Programs List */
.configuring-programs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  padding: 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

/* Fix 3: Panel error message */
.panel-error {
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #dc2626;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  animation: slideIn 0.2s ease;
}

/* Fix 4: Clear All button */
.state-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.state-section-header .modal-label {
  margin-bottom: 0;
}

.btn-clear-all {
  padding: 5px 12px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-clear-all:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  color: var(--gray-950);
}

/* Fix 6: Highlight recently saved rows */
.agency-row.just-saved {
  animation: highlightSaved 3s ease;
}

@keyframes highlightSaved {
  0% { background: var(--zomp-200); border-color: var(--zomp-500); }
  70% { background: var(--zomp-50); border-color: var(--zomp-200); }
  100% { background: white; border-color: var(--gray-200); }
}

/* Section heading */
.section-heading {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
