/* ============================================
   Components - Modals, Toggles, Badges, Cards
   ============================================ */

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* KPI Cards */
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-xl);
}

.kpi-card .kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.kpi-card .kpi-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-card .kpi-icon {
  display: none;
}

.kpi-card .kpi-value {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: var(--space-xs);
}

.kpi-card .kpi-change {
  font-size: 0.78rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kpi-card .kpi-change.positive {
  color: var(--color-success);
}

.kpi-card .kpi-change.negative {
  color: var(--color-danger);
}

.kpi-card .kpi-change.neutral {
  color: var(--color-warning);
}

.kpi-card .kpi-sub {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 550;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.5;
}

.btn-primary {
  background: var(--brand-primary);
  color: white;
  box-shadow: 0 1px 3px rgba(21, 94, 239, 0.3);
}

.btn-primary:hover {
  background: var(--brand-secondary);
  box-shadow: 0 4px 12px rgba(21, 94, 239, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

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

.btn-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.btn-sm {
  padding: 4px var(--space-md);
  font-size: 0.78rem;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 0.92rem;
}

/* --- Toggle Switch --- */
.toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle input {
  display: none;
}

.toggle .toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.toggle .toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #CBD5E1;
  transition: all var(--transition-base);
}

.toggle input:checked + .toggle-slider {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: white;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.badge-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info-border);
}

.badge-neutral {
  background: #F1F5F9;
  color: var(--text-secondary);
  border: 1px solid #E2E8F0;
}

.badge-premium {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge-enterprise {
  background: rgba(168, 85, 247, 0.1);
  color: #A855F7;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Sensitivity badges */
.badge-high {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

.badge-medium {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge-low {
  background: var(--color-info-bg);
  color: var(--color-info);
  border: 1px solid var(--color-info-border);
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-xl);
}

.tab {
  padding: var(--space-md) var(--space-xl);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
  bottom: -1px;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--brand-secondary);
  border-bottom-color: var(--brand-primary);
  font-weight: 600;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-overlay);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 580px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.97);
  transition: all var(--transition-base);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: transparent;
  transition: all var(--transition-fast);
  font-size: 1.2rem;
}

.modal-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-xl);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-subtle);
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-tertiary);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Form row inline */
.form-row {
  display: flex;
  gap: var(--space-lg);
}

.form-row .form-group {
  flex: 1;
}

/* --- Toggle with label --- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.toggle-row .toggle-info {
  flex: 1;
  margin-right: var(--space-lg);
}

.toggle-row .toggle-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-row .toggle-desc {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* --- Search Input --- */
.search-input {
  position: relative;
}

.search-input input {
  width: 100%;
  padding: var(--space-sm) var(--space-md) var(--space-sm) 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.15);
}

.search-input input::placeholder {
  color: var(--text-tertiary);
}

.search-input .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 0.85rem;
  pointer-events: none;
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
}

.filter-bar .search-input {
  min-width: 240px;
}

.filter-bar .form-select {
  width: auto;
  min-width: 160px;
}

/* --- Progress Bar --- */
.progress-bar {
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-bar .progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  transition: width var(--transition-slow);
}

/* --- License Bar --- */
.license-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.license-bar .license-info {
  flex: 1;
}

.license-bar .license-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.license-bar .license-count {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 600;
}

.license-bar .license-count span {
  color: var(--brand-secondary);
}

/* --- Settings Section --- */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  overflow: hidden;
}

.settings-section .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
}

.settings-section .section-head h3 {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.settings-section .section-body {
  padding: var(--space-lg) var(--space-xl);
}

.settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: var(--space-xl);
}

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

.settings-row .setting-info {
  flex: 1;
}

.settings-row .setting-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.settings-row .setting-value {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.settings-row .setting-control {
  flex-shrink: 0;
}

/* Disabled / Enterprise */
.settings-section.disabled {
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.settings-section.disabled::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 25, 0.3);
  border-radius: var(--radius-lg);
  pointer-events: none;
}

/* --- Notification Items --- */
.notification-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  margin-bottom: var(--space-md);
  display: flex;
  gap: var(--space-lg);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.notification-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.notification-item.unread {
  border-left: 3px solid var(--brand-primary);
}

.notification-item .notif-severity {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.notification-item .notif-severity.critical {
  background: var(--color-danger);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
}

.notification-item .notif-severity.warning {
  background: var(--color-warning);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.3);
}

.notification-item .notif-severity.info {
  background: var(--color-info);
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.3);
}

.notification-item .notif-content {
  flex: 1;
}

.notification-item .notif-type {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.notification-item .notif-message {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.5;
}

.notification-item .notif-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  margin-top: var(--space-sm);
}

.notification-item .notif-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
  align-self: center;
}

/* --- Risk Bars --- */
.risk-bar-container {
  margin-bottom: var(--space-lg);
}

.risk-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
  font-size: 0.85rem;
}

.risk-bar {
  height: 24px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}

.risk-bar .risk-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width var(--transition-slow);
  display: flex;
  align-items: center;
  padding-left: var(--space-md);
  font-size: 0.72rem;
  font-weight: 600;
  color: white;
}

.risk-fill.risk-high {
  background: linear-gradient(90deg, var(--color-danger), #f87171);
}

.risk-fill.risk-medium {
  background: linear-gradient(90deg, var(--color-warning), #fbbf24);
}

.risk-fill.risk-low {
  background: linear-gradient(90deg, var(--color-success), #4ade80);
}

/* --- Chart Containers --- */
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.chart-card .chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.chart-card .chart-title {
  font-size: 0.92rem;
  font-weight: 600;
}

.chart-card .chart-container {
  position: relative;
  width: 100%;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--text-tertiary);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-lg);
  opacity: 0.5;
}

.empty-state .empty-text {
  font-size: 0.92rem;
}

/* --- Tooltip --- */
[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tooltip);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 100;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-default);
  animation: tooltipIn 0.15s ease;
}

@keyframes tooltipIn {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- Stat Cards (Feedback, etc) --- */
.stat-cards {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  flex: 1;
  text-align: center;
}

.stat-card .stat-number {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* --- Alert Boxes --- */
.alert-box {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: 0.85rem;
  line-height: 1.5;
}

.alert-box.alert-warning {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  color: var(--color-warning);
}

.alert-box.alert-danger {
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  color: var(--color-danger);
}

.alert-box.alert-info {
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  color: var(--color-info);
}

/* ============================================
   Rule Selector — Split Panel
   ============================================ */

.rule-selector {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 420px;
}

/* --- Left: Category Nav --- */
.rule-selector-nav {
  width: 272px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
}

.rs-nav-header {
  padding: var(--space-lg) var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.rs-nav-header span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

.rs-nav-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-xs) 0;
}

.rs-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  margin: 0 var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  user-select: none;
  position: relative;
}

.rs-nav-item:hover {
  background: var(--bg-sidebar-hover);
}

.rs-nav-item.selected {
  background: var(--bg-sidebar-active);
}

.rs-nav-item.selected::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--brand-primary);
}

/* Category color dot */
.rs-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rs-cat-dot.dot-pii { background: var(--color-info); }
.rs-cat-dot.dot-credentials { background: var(--color-danger); }
.rs-cat-dot.dot-international { background: var(--color-warning); }
.rs-cat-dot.dot-custom { background: #A855F7; }

.rs-nav-info {
  flex: 1;
  min-width: 0;
}

.rs-nav-name {
  font-size: 0.84rem;
  font-weight: 550;
  color: var(--text-primary);
}

.rs-nav-count {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  margin-top: 1px;
}

.rs-nav-count .on {
  color: var(--color-success);
  font-weight: 600;
}

.rs-nav-toggle {
  flex-shrink: 0;
}

/* Indeterminate toggle */
.toggle.indeterminate .toggle-slider {
  background: var(--color-warning);
  border-color: var(--color-warning);
}

.toggle.indeterminate .toggle-slider::before {
  background: #fff;
  transform: translateX(9px);
}

/* --- Right: Rule Detail --- */
.rule-selector-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rs-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  background: #F8FAFC;
  min-height: 48px;
}

.rs-detail-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.rs-detail-actions {
  display: flex;
  gap: var(--space-sm);
}

.rs-rule-list {
  flex: 1;
  overflow-y: auto;
}

/* Individual rule row */
.rs-rule {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast), opacity var(--transition-fast);
}

.rs-rule:last-child {
  border-bottom: none;
}

.rs-rule:hover {
  background: var(--bg-card-hover);
}

.rs-rule.off {
  opacity: 0.4;
}

/* Sensitivity accent bar */
.rs-rule-accent {
  width: 3px;
  align-self: stretch;
  flex-shrink: 0;
  border-radius: 0;
}

.rs-rule-accent.sens-low { background: var(--color-info); }
.rs-rule-accent.sens-medium { background: var(--color-warning); }
.rs-rule-accent.sens-high { background: var(--color-danger); }

.rs-rule-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg) var(--space-md) var(--space-md);
  min-width: 0;
}

.rs-rule-toggle {
  flex-shrink: 0;
}

.rs-rule-info {
  flex: 1;
  min-width: 0;
}

.rs-rule-name {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
}

.rs-rule-example {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rs-rule-badge {
  flex-shrink: 0;
}

/* Empty / no-selection state */
.rs-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 280px;
  color: var(--text-tertiary);
  gap: var(--space-sm);
}

.rs-empty-text {
  font-size: 0.84rem;
}

/* Responsive */
@media (max-width: 768px) {
  .rule-selector {
    flex-direction: column;
    min-height: auto;
  }

  .rule-selector-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    max-height: 200px;
  }
}
