/* 영업관리 프로그램 - aina.run 참고: 부드러운 톤, 고대비 완화 */

/* 전역 라이트 테마: 부드러운 배경·중간 톤 글자·소프트 버튼 (aina.run 참고) */
[data-theme="light"] {
	--b1: 0.985 0.002 90;
	--b2: 0.97 0.002 90;
	--b3: 0.94 0.004 90;
	--bc: 0.42 0.01 260;
	--p: 0.52 0.08 250;
	--pc: 0.99 0 0;
	--pf: 0.44 0.08 250;
	--s: 0.5 0.04 260;
	--sc: 0.98 0 0;
	--a: 0.5 0.06 260;
	--ac: 0.98 0 0;
	--n: 0.48 0.01 260;
	--nc: 0.98 0 0;
	--in: 0.5 0.06 240;
	--inc: 0.98 0 0;
	--su: 0.52 0.06 145;
	--suc: 0.98 0 0;
	--wa: 0.65 0.1 85;
	--wac: 0.25 0.02 85;
	--er: 0.52 0.12 25;
	--erc: 0.98 0 0;
}

/* aina.run 스타일: 포커스·테두리 부드럽게 */
[data-theme="light"] .input:focus,
[data-theme="light"] .textarea:focus,
[data-theme="light"] .select:focus,
[data-theme="light"] .btn:focus-visible {
	outline: 2px solid oklch(0.52 0.08 250 / 0.4);
	outline-offset: 2px;
}
[data-theme="light"] .input-bordered,
[data-theme="light"] .textarea-bordered,
[data-theme="light"] .select-bordered {
	border-color: oklch(0.94 0.004 90);
}
[data-theme="light"] .card {
	border-radius: 0.75rem;
	box-shadow: 0 1px 3px oklch(0 0 0 / 0.06);
}

/* Input 높이 통일 (업체명 input 기준 - 모든 페이지 적용) */
.input,
input.input {
	min-height: 3.25rem;
	padding-top: 0.625rem;
	padding-bottom: 0.625rem;
	line-height: 1.5;
	box-sizing: border-box;
}
select.input,
.select,
select.select {
	min-height: 3.25rem;
	padding-top: 0.625rem;
	padding-bottom: 0.625rem;
	line-height: 1.5;
	box-sizing: border-box;
}
.input-sm,
input.input-sm {
	min-height: 2.875rem;
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}
select.input-sm,
.select.select-sm {
	min-height: 2.875rem;
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}
.textarea,
textarea.textarea {
	min-height: 5.5rem;
	padding: 0.625rem 0.75rem;
	line-height: 1.5;
	box-sizing: border-box;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: oklch(var(--b2));
}

::-webkit-scrollbar-thumb {
    background: oklch(var(--bc) / 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: oklch(var(--bc) / 0.3);
}

/* 배지: 좁은 화면에서 줄바꿈 방지(리드 상태 등) */
.badge {
    white-space: nowrap;
}

/* 그룹명 배지: 최대 12자리, 초과 시 말줄임(...) */
.badge-group-name {
    display: inline-block;
    max-width: 12em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* 그룹 목록: 나머지 그룹 슬라이드 영역 */
.group-extra {
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
}
.group-extra.open {
    max-height: 120px;
}

/* 메뉴 활성 상태 */
.menu li > a.active {
    background-color: oklch(var(--p) / 0.1);
    color: oklch(var(--p));
}

/* 테이블 호버 효과 */
.table tbody tr:hover {
    background-color: oklch(var(--b2));
}

/* 카드 호버 효과 */
.card-hover:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* 체크박스 선택된 행 */
.table tbody tr.selected {
    background-color: oklch(var(--p) / 0.05);
}

/* 뱃지 커스텀 */
.badge-activity-call {
    background-color: oklch(var(--p) / 0.1);
    color: oklch(var(--p));
}

.badge-activity-email {
    background-color: oklch(var(--s) / 0.1);
    color: oklch(var(--s));
}

.badge-activity-meeting {
    background-color: oklch(var(--a) / 0.1);
    color: oklch(var(--a));
}

.badge-activity-visit {
    background-color: oklch(var(--in) / 0.1);
    color: oklch(var(--in));
}

/* 필터 패널 */
.filter-panel {
    background-color: oklch(var(--b1));
    border: 1px solid oklch(var(--bc) / 0.1);
}

/* 탭 컨텐츠 전환 */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 타임라인 스타일 */
.timeline-item {
    position: relative;
    padding-left: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 24px;
    bottom: -16px;
    width: 2px;
    background-color: oklch(var(--bc) / 0.1);
}

.timeline-item:last-child::before {
    display: none;
}

/* 드래그 앤 드롭 영역 */
.drop-zone {
    border: 2px dashed oklch(var(--bc) / 0.2);
    transition: all 0.2s;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: oklch(var(--p));
    background-color: oklch(var(--p) / 0.05);
}

/* 로딩 오버레이 */
.loading-overlay {
    position: fixed;
    inset: 0;
    background-color: oklch(var(--b1) / 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* 상태별 색상 */
.status-new { color: oklch(var(--in)); }
.status-trying { color: oklch(var(--wa)); }
.status-connected { color: oklch(var(--su)); }
.status-nurturing { color: oklch(var(--p)); }
.status-proposal { color: oklch(var(--s)); }
.status-negotiating { color: oklch(var(--a)); }
.status-won { color: oklch(var(--su)); }
.status-lost { color: oklch(var(--er)); }
.status-blocked { color: oklch(var(--bc) / 0.5); }

/* 관심도 별점 */
.interest-level {
    display: inline-flex;
    gap: 2px;
}

.interest-level .star {
    width: 12px;
    height: 12px;
    background-color: oklch(var(--bc) / 0.2);
}

.interest-level .star.filled {
    background-color: oklch(var(--wa));
}

/* 반응형 테이블 */
.table-responsive {
    overflow-x: auto;
}

/* 폼 그룹 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group .required::after {
    content: ' *';
    color: oklch(var(--er));
}

/* 모달 오버레이 애니메이션 */
.modal-box {
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 알림 토스트 */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* 검색 하이라이트 */
.highlight {
    background-color: oklch(var(--wa) / 0.3);
    padding: 0 2px;
    border-radius: 2px;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: oklch(var(--bc) / 0.5);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* 진행률 표시 */
.progress-bar {
    height: 8px;
    background-color: oklch(var(--bc) / 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .progress-fill {
    height: 100%;
    background-color: oklch(var(--p));
    transition: width 0.3s ease;
}

/* 파일 업로드 미리보기 */
.file-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background-color: oklch(var(--b2));
    border-radius: 0.5rem;
}

.file-preview .file-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: oklch(var(--er) / 0.1);
    color: oklch(var(--er));
    border-radius: 0.375rem;
}

/* 다중 선택 태그 */
.tag-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 1px solid oklch(var(--bc) / 0.2);
    border-radius: 0.5rem;
    min-height: 42px;
}

.tag-input .tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: oklch(var(--p) / 0.1);
    color: oklch(var(--p));
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.tag-input .tag button {
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
}

.tag-input .tag button:hover {
    opacity: 1;
}

/* PDF 추출 결과 카드 */
.extract-result-card {
    border: 1px solid oklch(var(--bc) / 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

.extract-result-card .card-header {
    padding: 1rem;
    background-color: oklch(var(--b2));
    border-bottom: 1px solid oklch(var(--bc) / 0.1);
}

.extract-result-card .card-body {
    padding: 1rem;
}

/* 웹사이트 상태 표시 */
.website-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.website-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.website-status .dot.active {
    background-color: oklch(var(--su));
}

.website-status .dot.inactive {
    background-color: oklch(var(--er));
}

.website-status .dot.unknown {
    background-color: oklch(var(--wa));
}
