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

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

:root {
  --bg: #F5F0E8;
  --card: #FAF8F5;
  --border: #E8E4DC;
  --text: #3D3D3D;
  --muted: #6B6B6B;
  --light: #D5C8B5;
  --primary: #1E40AF;
  --primary-hover: #1E3A8A;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #F5F0E8;
}

::-webkit-scrollbar-thumb {
  background: #D5C8B5;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #E8E4DC;
}

input:focus,
select:focus,
button:focus {
  outline: none;
}

/* Header */
header {
  background: white;
  border-bottom: 1px solid #E5E7EB;
  padding: 20px 24px;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.logo h1 {
  font-size: 20px;
  font-weight: 600;
  color: #111;
}

.logo p {
  font-size: 14px;
  color: #6B7280;
  margin-top: 2px;
}

.header-actions {
  display: flex;
  gap: 12px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  background: #D1D5DB;
  cursor: not-allowed;
}

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

.btn-secondary:hover {
  border-color: var(--light);
}

.btn-muji {
  background: var(--light);
  color: var(--text);
}

.btn-muji:hover {
  background: #C4B9A8;
}

/* Main */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.card h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 16px;
}

/* File Upload */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--light);
  background: #FAF8F5;
}

.upload-zone.dragging {
  border-color: var(--primary);
  background: #EFF6FF;
}

.upload-zone svg {
  width: 40px;
  height: 40px;
  color: var(--muted);
  margin-bottom: 12px;
}

.upload-zone p {
  color: var(--muted);
  font-size: 14px;
}

/* Group Selector */
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: white;
  color: var(--text);
}

select:focus {
  border-color: var(--primary);
}

.label-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  margin-bottom: 8px;
}

.group-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-tag {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.group-tag.unselected {
  background: white;
  border: 1px solid var(--border);
  color: var(--muted);
}

.group-tag.unselected:hover {
  border-color: var(--light);
}

.group-tag.selected {
  background: var(--light);
  border: 1px solid var(--light);
  color: var(--text);
}

.group-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.drag-handle {
  cursor: grab;
  font-size: 12px;
  opacity: 0.5;
}

.dragging-item {
  opacity: 0.5;
}

/* Question Selector */
.question-module {
  margin-bottom: 16px;
}

.question-module h4 {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.question-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.question-item:hover {
  background: #F5F0E8;
}

.question-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #1E40AF;
}

.question-item span {
  font-size: 14px;
  color: var(--text);
}

.question-item .type-tag {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.select-all {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
}

.select-all:hover {
  color: var(--text);
}

/* Result Preview */
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.preview-list {
  max-height: 500px;
  overflow-y: auto;
}

.result-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.result-item h4 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-item .type-tag {
  font-size: 11px;
  color: var(--muted);
  background: #F5F0E8;
  padding: 2px 8px;
  border-radius: 4px;
}

table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

th, td {
  padding: 6px 8px;
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 400;
  border-bottom: 1px solid var(--border);
}

td {
  color: var(--text);
}

th.center, td.center {
  text-align: center;
}

.base-row {
  background: #F5F0E8;
}

.mean-row {
  border-top: 1px solid var(--border);
}

.empty-state {
  text-align: center;
  padding: 60px;
  color: var(--muted);
}

/* Footer */
footer {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 12px;
}
