.goal-config {
	display: flex;
	flex-direction: column;

	// ── 목록 패널 ────────────────────────────────────
	&__list-panel {
		display: flex;
		flex-direction: column;
		gap: 0;
	}

	// ── 30/70 레이아웃 ────────────────────────────────
	&__layout {
		display: grid;
		grid-template-columns: minmax(0, 500px) auto 1fr;
		gap: 24px;
		align-items: start;
	}

	// ── 좌측 패널 (미리보기) ─────────────────────────
	&__preview-panel {
		position: sticky;
		top: 16px;
		display: flex;
		flex-direction: column;
		gap: 16px;
		max-height: calc(100vh - 48px);
		overflow-y: auto;
	}

	// ── 우측 패널 (폼) ───────────────────────────────
	&__form-panel {
		display: flex;
		flex-direction: column;
		gap: 0;
	}

	// ── 섹션 (제목 좌 / 콘텐츠 우) ──────────────────
	&__section {
		display: grid;
		grid-template-columns: 140px 1fr;
		gap: 24px;
		padding: 24px 0;
		border-bottom: 1px solid hsl(var(--border));

		&:first-of-type {
			padding-top: 0;
		}
	}

	&__section-title {
		font-size: 0.875rem;
		font-weight: 600;
		color: hsl(var(--foreground));
		padding-top: 2px;
		margin: 0;
	}

	&__section-body {
		display: flex;
		flex-direction: column;
		gap: 17px;
		max-width: 520px;
	}

	// ── 위젯 미리보기 ────────────────────────────────
	&__widget {
		border: 1px solid hsl(var(--border));
		border-radius: var(--radius);
		overflow: hidden;
	}

	&__widget-label {
		padding: 8px 14px;
		font-size: 0.8125rem;
		font-weight: 500;
		color: hsl(var(--muted));
		background: #0e0e1a;
	}

	&__widget-body {
		padding: 16px;
		background: #1a1a2e;
	}

	// ── 툴바 ─────────────────────────────────────────
	&__toolbar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 8px;
		margin-bottom: 12px;
		flex-wrap: wrap;
	}

	&__toolbar-left {
		display: flex;
		align-items: baseline;
		gap: 6px;
	}

	&__toolbar-right {
		display: flex;
		align-items: center;
		gap: 6px;
		flex-wrap: wrap;
	}

	&__count {
		font-size: 0.8125rem;
		color: hsl(var(--muted-foreground));
	}

	&__per-page {
		padding: 9px 10px;
		border: 1px solid hsl(var(--border));
		border-radius: calc(var(--radius) - 2px);
		background: hsl(var(--background));
		color: hsl(var(--foreground));
		font-size: 0.875rem;
		cursor: pointer;
	}

	// ── 버튼 ─────────────────────────────────────────
	&__btn {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		padding: 8px 16px;
		border: 1px solid hsl(var(--border));
		border-radius: calc(var(--radius) - 2px);
		background: hsl(var(--background));
		color: hsl(var(--foreground));
		font-size: 0.875rem;
		font-weight: 500;
		cursor: pointer;
		white-space: nowrap;
		transition: background-color 0.15s, color 0.15s;
		justify-content: center;

		&:not([class*="--"]):hover:not(:disabled) {
			background: hsl(var(--accent));
			color: hsl(var(--accent-foreground));
		}

		&:disabled {
			opacity: 0.5;
			cursor: not-allowed;
		}

		&--sm {
			padding: 4px 10px;
			font-size: 0.75rem;
		}

		&--primary {
			background: hsl(var(--primary));
			color: hsl(var(--primary-foreground));
			border-color: hsl(var(--primary));

			&:hover:not(:disabled) {
				background: hsl(var(--primary) / 0.9);
				color: hsl(var(--primary-foreground));
			}
		}

		&--danger {
			color: hsl(var(--destructive));
			border-color: hsl(var(--destructive) / 0.5);

			&:hover:not(:disabled) {
				background: hsl(var(--destructive) / 0.1);
			}
		}
	}

	// ── 테이블 ───────────────────────────────────────
	&__table-wrap {
		border: 1px solid hsl(var(--border));
		border-radius: var(--radius);
		overflow: hidden;
	}

	&__table {
		width: 100%;
		border-collapse: collapse;
		font-size: 0.8125rem;

		th, td {
			padding: 10px 12px;
			text-align: left;
			border-bottom: 1px solid hsl(var(--border));
		}

		th {
			font-weight: 500;
			color: hsl(var(--muted-foreground));
			font-size: 0.75rem;
			background: hsl(var(--muted) / 0.4);
		}

		tbody tr:last-child td {
			border-bottom: none;
		}

		tbody tr {
			transition: background 0.15s;
		}

		tbody tr:hover {
			background: hsl(var(--muted) / 0.5);
		}
	}

	&__th--check,
	&__td--check {
		width: 40px;
		text-align: center;
	}

	&__td--date {
		white-space: nowrap;
		font-size: 0.75rem;
	}

	&__td--bar {
		min-width: 200px;
	}

	// ── 미니 프로그레스바 ────────────────────────────
	&__mini-bar {
		position: relative;
		height: 22px;
		border-radius: 4px;
		overflow: hidden;
		min-width: 160px;
	}

	&__mini-bar-fill {
		height: 100%;
		border-radius: 4px;
		transition: width 0.3s ease;
	}

	&__mini-bar-text {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 0.6875rem;
		font-weight: 600;
		color: #fff;
		white-space: nowrap;
		text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 1px rgba(0, 0, 0, 0.4);
		pointer-events: none;
	}

	&__row--checked {
		opacity: 0.5;

		td {
			text-decoration: line-through;
		}
	}

	&__status-badge {
		display: inline-flex;
		align-items: center;
		padding: 2px 8px;
		border-radius: calc(var(--radius) - 2px);
		font-size: 0.6875rem;
		font-weight: 500;
		white-space: nowrap;

		&--active {
			background: hsl(142 71% 45% / 0.1);
			color: hsl(142 71% 45%);
		}

		&--inactive {
			background: hsl(var(--muted));
			color: hsl(var(--muted-foreground));
		}
	}

	&__empty {
		padding: 48px 16px;
		text-align: center;
		color: hsl(var(--muted-foreground));
		font-size: 0.875rem;
	}

	&__loading {
		padding: 48px 16px;
		text-align: center;
		color: hsl(var(--muted-foreground));
		font-size: 0.875rem;
	}

	// ── 페이징 ───────────────────────────────────────
	&__pagination {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 4px;
		margin-top: 12px;
	}

	&__page-btn {
		min-width: 28px;
		height: 28px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		border: 1px solid hsl(var(--border));
		border-radius: calc(var(--radius) - 2px);
		background: hsl(var(--background));
		color: hsl(var(--foreground));
		font-size: 0.75rem;
		cursor: pointer;
		transition: background-color 0.15s;

		&:hover:not(:disabled) {
			background: hsl(var(--accent));
		}

		&:disabled {
			opacity: 0.5;
			cursor: not-allowed;
		}

		&--active {
			background: hsl(var(--primary));
			color: hsl(var(--primary-foreground));
			border-color: hsl(var(--primary));
		}
	}

	// ── 폼 필드 ──────────────────────────────────────
	&__field {
		display: flex;
		flex-direction: column;
		gap: 6px;
	}

	&__field-label {
		font-size: 0.875rem;
		font-weight: 500;
		color: hsl(var(--foreground));
	}

	&__field-row {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	&__input {
		padding: 8px 12px;
		border: 1px solid hsl(var(--border));
		border-radius: calc(var(--radius) - 2px);
		background: hsl(var(--background));
		color: hsl(var(--foreground));
		font-size: 0.875rem;
		width: 100%;

		&::placeholder {
			color: hsl(var(--muted-foreground));
		}
	}

	&__select {
		padding: 8px 12px;
		border: 1px solid hsl(var(--border));
		border-radius: calc(var(--radius) - 2px);
		background: hsl(var(--background));
		color: hsl(var(--foreground));
		font-size: 0.875rem;
		width: 100%;
		cursor: pointer;
	}

	&__checkbox-label {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		font-size: 0.875rem;
		color: hsl(var(--foreground));
		cursor: pointer;
	}

	// ── 폰트 그룹 ────────────────────────────────────
	&__font-group {
		&:not(:first-child) {
			margin-top: 12px;
			padding-top: 12px;
			border-top: 1px solid hsl(var(--border));
		}
	}

	&__font-group-title {
		font-size: 0.875rem;
		font-weight: 500;
		color: hsl(var(--muted-foreground));
		margin-bottom: 10px;
	}

	&__font-grid {
		display: grid;
		grid-template-columns: 1fr 80px 1fr;
		gap: 12px;
		align-items: start;
	}

	// ── 색상 입력 ─────────────────────────────────────
	&__color-wrap {
		display: flex;
		gap: 8px;
		align-items: center;
	}

	&__color-input {
		width: 36px;
		height: 36px;
		padding: 2px;
		border: 1px solid hsl(var(--border));
		border-radius: calc(var(--radius) - 2px);
		background: hsl(var(--background));
		cursor: pointer;
		flex-shrink: 0;

		&::-webkit-color-swatch-wrapper {
			padding: 0;
		}

		&::-webkit-color-swatch {
			border: none;
			border-radius: calc(var(--radius) - 4px);
		}
	}

	&__color-text {
		flex: 1;
		min-width: 0;
	}

	// ── 폼 하단 ──────────────────────────────────────
	&__form-footer {
		display: flex;
		justify-content: center;
		gap: 8px;
		padding-top: 20px;
		margin-top: 4px;
	}
}

// ── 목표 바 미리보기 ─────────────────────────────────
.goal-preview {
	display: flex;
	flex-direction: column;
	gap: 6px;

	&__title {
		text-align: center;
		font-weight: 600;
		line-height: 1.3;
	}

	&__bar-wrap {
		border-radius: 4px;
		overflow: hidden;
		position: relative;
		min-height: 24px;
	}

	&__bar-fill {
		border-radius: 4px;
		transition: width 0.3s ease;
	}

	&__amount {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: center;
		z-index: 1;
		line-height: 1.3;
		white-space: nowrap;
		text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7), 0 0 2px rgba(0, 0, 0, 0.5);
	}

	&__percent {
		opacity: 0.7;
	}
}

// ── 반응형 ────────────────────────────────────────────
@media (max-width: 1380px) {
	.goal-config {
		&__layout {
			grid-template-columns: minmax(0, 500px) auto 1fr;
			gap: 24px;
			align-items: start;
		}

		&__section {
			grid-template-columns: 1fr;
			gap: 5px;
		}

		&__section-title {
			margin-bottom: 9px;
		}
	}
}

@media (max-width: 1120px) {
	.goal-config {
		&__layout {
			grid-template-columns: 2fr auto 3fr;
		}
	}
}

@media (max-width: 768px) {
	.goal-config {
		&__layout {
			grid-template-columns: 1fr;
		}

		&__preview-panel {
			position: static;
			max-height: none;
		}

		&__section {
			grid-template-columns: 1fr;
			gap: 8px;
		}

		&__section-title {
			margin-bottom: 12px;
		}

		&__section-body {
			max-width: none;
		}

		&__field-row {
			grid-template-columns: 1fr;
		}

		&__font-grid {
			grid-template-columns: 1fr;
		}

		&__toolbar {
			flex-direction: column;
			align-items: flex-start;
		}

		&__table-wrap {
			overflow-x: auto;
		}

		&__table {
			min-width: 892px;
		}
	}
}