/* Giao diện Modal 3 mức độ, Tour hướng dẫn, Popover từ điển mini, Checklist và Toast */
/* Sử dụng nền kem ấm #FAF7F0 cho Popover từ điển chuẩn phong cách HuyForum */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(6, 20, 15, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.kpi-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.level-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.level-tab {
  min-height: 58px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 150ms ease, border-color 150ms ease;
}

.level-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.dict-popover {
  position: fixed;
  z-index: 95;
  width: min(330px, calc(100vw - 24px));
  background: var(--surface-warm);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-md);
  display: none;
}

.dict-popover.open {
  display: block;
}

.toast-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 98;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
}

.toast {
  background: var(--text);
  color: var(--surface);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  min-height: 48px;
}

.check-item.checked {
  background: var(--success-soft);
  border-color: var(--success-border);
}

.check-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
