/* ============================================================
   Alux Product 제안 목업 — 콘텐츠 컴포넌트 CSS
   ※ 반드시 app.css(운영 프로덕션 CSS 번들) 다음에 로드한다.
     - 디자인 토큰(:root/.dark/[data-accent])과 Tailwind 유틸리티,
       Geist 폰트는 전부 app.css가 제공한다.
     - 이 파일은 페이지 콘텐츠용 컴포넌트 클래스만 정의하며,
       모든 값은 운영 shadcn/ui 컴포넌트의 실측 값과 일치시킨다.
   ============================================================ */

/* 보조 시맨틱 토큰 (운영 status-badge tone: green/amber/red/blue/gray 와 동일 계열) */
:root {
  color-scheme: light;                            /* 네이티브 위젯(select 팝업·option·date·스크롤바) 라이트 렌더 */
  --success: oklch(50.8% .118 165.612);          /* emerald-700 */
  --success-bg: oklch(95% .052 163.051);          /* emerald-100 */
  --warning: oklch(55.5% .163 48.998);            /* amber-700 */
  --warning-bg: oklch(96.2% .059 95.617);         /* amber-100 */
  --info-bg: color-mix(in oklab, var(--primary) 10%, transparent);
}
.dark {
  color-scheme: dark;                             /* ★근본: 없으면 다크에서 select 옵션·날짜·스크롤바가 밝은 기준으로 그려져 글자 안 보임(2026-07-21 지상기 전수검사) */
  --success: oklch(84.5% .143 164.978);
  --success-bg: oklch(69.6% .17 162.48 / .15);
  --warning: oklch(87.9% .169 91.605);
  --warning-bg: oklch(66.6% .179 58.318 / .18);
}
/* 일부 브라우저(Windows Chrome/Edge)는 color-scheme만으로 <option> 배경을 안 바꾸므로 명시 보강 — 드롭다운 옵션 글자 대비 확보 */
.dark select option { background-color: oklch(20.5% 0 0); color: oklch(98.5% 0 0); }

/* ---------- 카드 (운영 shadcn Card: rounded-xl border shadow-sm) ---------- */
.card {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: .75rem;
  padding: 1.25rem 1.25rem;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
}
.card h3 { margin: 0 0 .15rem; font-size: .95rem; font-weight: 600; }
.card .card-desc { color: var(--muted-foreground); font-size: .8rem; margin: 0 0 .75rem; }
.card-grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

.stat-card .stat-label { font-size: .8rem; color: var(--muted-foreground); }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; margin: .15rem 0; color: var(--foreground); }
.stat-card .stat-hint { font-size: .75rem; color: var(--muted-foreground); }
.stat-card .stat-hint.up { color: var(--success); }
.stat-card .stat-hint.down { color: var(--destructive); }

/* ---------- 페이지 헤더 (운영 page-header 칩: text-2xl font-bold + mt-1 text-sm muted) ---------- */
/* flex-wrap: 좁은 화면에서 우측 컨트롤이 다음 줄로 내려가 제목이 전체 폭을 확보(제목이 세로로 쪼개지던 문제, 2026-07-20).
   h1 white-space:nowrap: 좁아져도 제목이 한 글자씩 세로로 깨지지 않게. */
.page-header { margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.page-header h1 { font-size: 1.5rem; line-height: 2rem; font-weight: 700; margin: 0; color: var(--foreground); white-space: nowrap; }
.page-header p { margin: .25rem 0 0; color: var(--muted-foreground); font-size: .875rem; }

/* ---------- 버튼 (운영 Button cva 실측: h-9 px-4 rounded-md text-sm font-medium) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  white-space: nowrap; border-radius: .375rem;
  font-size: .875rem; font-weight: 500; line-height: 1.25rem;
  height: 2.25rem; padding: .5rem 1rem;
  border: 1px solid transparent; cursor: pointer;
  transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: color-mix(in oklab, var(--primary) 90%, transparent); }
.btn-outline { background: var(--background); border-color: var(--input); color: var(--foreground); box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05); }
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-destructive { background: var(--destructive); color: #fff; }
.btn-destructive:hover { background: color-mix(in oklab, var(--destructive) 90%, transparent); }
.btn-success { background: oklch(59.6% .145 163.225); color: #fff; }
.btn-success:hover { background: oklch(59.6% .145 163.225 / .9); }
.btn-warning { background: oklch(66.6% .179 58.318); color: #fff; }
.btn-warning:hover { background: oklch(66.6% .179 58.318 / .9); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-sm { height: 2rem; padding: 0 .75rem; gap: .375rem; font-size: .8125rem; }
.btn-icon { width: 2.25rem; padding: 0; }

/* ---------- 뱃지 (운영 Badge/StatusBadge cva 실측: rounded-full px-2 py-0.5 text-xs) ---------- */
.badge {
  display: inline-flex; align-items: center; justify-content: center; gap: .25rem;
  border-radius: 999px; padding: .125rem .5rem; width: fit-content;
  font-size: .75rem; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-default { background: var(--primary); color: var(--primary-foreground); }
.badge-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.badge-outline { border-color: var(--border); color: var(--foreground); background: transparent; }
/* 운영 status-badge tone 매핑: blue/green/amber/red/gray */
.badge-info { background: color-mix(in oklab, var(--primary) 10%, transparent); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-destructive { background: color-mix(in oklab, var(--destructive) 10%, transparent); color: var(--destructive); }
.badge-muted { background: var(--muted); color: var(--muted-foreground); }

.badge-new {
  margin-left: auto; font-size: 10px; font-weight: 700; line-height: 1.6;
  background: color-mix(in oklab, var(--primary) 10%, transparent); color: var(--primary);
  border-radius: 999px; padding: 0 .375rem;
}

/* ---------- 제안 배너 ---------- */
.proposal-banner {
  display: flex; align-items: center; gap: .6rem;
  background: var(--info-bg); border: 1px dashed var(--ring);
  border-radius: .75rem; padding: .6rem .9rem;
  font-size: .8rem; margin-bottom: 1.25rem; color: var(--foreground);
}
.proposal-banner b { color: var(--primary); }

/* ---------- 탭 = 세그먼트 토글(2026-07-21 지상기 승인) — 테두리로 감싼 붙은 버튼 + active=진한 파랑, 높이 34px 통일.
   .tabs/.tab 공통이라 mywork(작업·문서/담당·요청·전체/뷰)·index(상태필터)·auto·org 전 화면 자동 적용 ---------- */
.tabs {
  display: inline-flex; align-items: center; height: 34px;
  border: 1px solid var(--border); border-radius: .5rem; overflow: hidden;
  background: var(--card); margin-bottom: 1rem;
}
.tab {
  height: 100%; padding: 0 .85rem; border: none; border-right: 1px solid var(--border); border-radius: 0;
  font-size: .82rem; color: var(--muted-foreground); background: transparent;
  cursor: pointer; font-family: inherit; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .3rem;
}
.tab:last-child { border-right: none; }
.tab:hover:not(.active) { background: color-mix(in oklab, var(--primary) 9%, transparent); color: var(--foreground); }
.tab.active { background: var(--primary); color: var(--primary-foreground, #fff); }
.tab.active .badge { background: rgba(255,255,255,.24); color: #fff; border-color: transparent; }

/* ---------- 테이블 (운영 Table 실측: text-sm, th=muted-foreground font-medium, hover:bg-muted/50) ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th {
  text-align: left; font-weight: 500; color: var(--muted-foreground);
  padding: .5rem .75rem; border-bottom: 1px solid var(--border); font-size: .75rem;
}
table.data td { padding: .625rem .75rem; border-bottom: 1px solid var(--border); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: color-mix(in oklab, var(--muted) 50%, transparent); }

/* ---------- 폼 (운영 Input 실측: h-9 rounded-md border-input shadow-xs) ---------- */
.input, .select, textarea.input {
  width: 100%; min-width: 0; background: transparent; color: var(--foreground);
  border: 1px solid var(--input); border-radius: .375rem;
  height: 2.25rem; padding: .25rem .75rem; font-size: .875rem; font-family: inherit;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
  transition: color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: .5rem .75rem; }
.select { appearance: auto; }
.dark .input, .dark .select, .dark textarea.input { background: color-mix(in oklab, var(--input) 30%, transparent); }
.input::placeholder { color: var(--muted-foreground); }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
}
.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .8125rem; font-weight: 500; margin-bottom: .375rem; color: var(--foreground); }
.field .hint { font-size: .75rem; color: var(--muted-foreground); margin-top: .25rem; }

.checkbox-row { display: flex; align-items: flex-start; gap: .5rem; font-size: .875rem; }
.checkbox-row input[type=checkbox] { accent-color: var(--primary); width: 1rem; height: 1rem; margin-top: .125rem; }

/* 스위치 (운영 Switch 실측 근사) */
.switch { position: relative; display: inline-block; width: 2rem; height: 1.15rem; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; background: var(--input); transition: .15s; }
.switch .slider::before {
  content: ""; position: absolute; width: .9rem; height: .9rem;
  left: 2px; top: 2px; border-radius: 999px; background: var(--background);
  box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: .15s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(.85rem); }

/* ---------- 프로그레스 (운영 Progress: h-2 rounded-full bg-primary/20) ---------- */
.progress { height: .5rem; background: color-mix(in oklab, var(--primary) 20%, transparent); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

/* ---------- 아바타 ---------- */
.avatar {
  width: 1.75rem; height: 1.75rem; border-radius: 999px;
  background: color-mix(in oklab, var(--primary) 10%, transparent); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 600; flex-shrink: 0;
}
.avatar.a2 { background: var(--success-bg); color: var(--success); }
.avatar.a3 { background: var(--warning-bg); color: var(--warning); }
.avatar.a4 { background: color-mix(in oklab, var(--destructive) 10%, transparent); color: var(--destructive); }
.avatar.sm { width: 1.5rem; height: 1.5rem; font-size: .62rem; }

/* ---------- 칸반 ---------- */
/* minmax(0,1fr): 1fr만 쓰면 긴 제목이 열을 밀어 열폭이 달라짐 — 4열 항상 동일폭(2026-07-07 지시) */
/* align-items:start 였을 때 각 열이 '자기 내용 높이'만큼만 늘어나 → 항목 적은 열(진행 전)의 드롭 영역이
   기존 카드 바로 아래로 좁아져 드래그 이동이 안 되던 문제(2026-07-16 박재량). stretch로 열 전체가 드롭 영역. */
/* 상태 3단화(2026-07-17) — 요청/진행/완료. 4칸 고정이던 것을 3칸으로 (줄인 만큼 폭 맞춤). */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kanban-col { background: var(--muted); border-radius: .75rem; padding: .6rem; min-height: 120px; transition: background .12s ease, box-shadow .12s ease; }
/* ── 칸반 드래그 = SortableJS(1.15.7). 손으로 짠 HTML5 DnD 제거(2026-07-16) ──
   이전엔 .kanban-col.drop-target 으로 '열 전체'에 점선을 둘러 어느 자리에 들어갈지 알 수 없었다.
   이제 집은 카드만 강조(k-chosen)하고, 들어갈 자리에 빈 칸(k-ghost)이 열려 순서가 보인다. */
/* 드롭 영역=컬럼 전체(2026-07-19 지상기 "빈 요청·완료로 드래그 이동이 안 된다") —
   min-height 48px뿐이면 빈 컬럼의 상단 얇은 띠에만 떨어뜨릴 수 있어 드롭이 안 걸렸다.
   컬럼을 세로 flex로 만들고 리스트가 남은 높이를 다 차지하게 해 어디에 놓아도 들어간다. */
.kanban-col { display: flex; flex-direction: column; }
.kanban-list { display: flex; flex-direction: column; gap: .4rem; min-height: 140px; flex: 1 1 auto; }
/* 집힌 '카드'에만 — 열에는 아무 표시도 하지 않는다 */
/* ★ SortableJS는 같은 요소에 k-chosen 과 k-ghost 를 동시에 단다(ghost=원본을 드롭자리로 옮긴 것).
   :not(.k-ghost) 로 분리해야 "집은 카드만 강조 + 빈 자리는 점선"이 각각 보인다. */
.kanban-card.k-chosen:not(.k-ghost) { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in oklab, var(--primary) 32%, transparent); }
/* 들어갈 자리(드롭 인덱스)에 열리는 빈 칸 — 내용은 숨기고 점선 윤곽만 */
.kanban-card.k-ghost { background: transparent; border: 2px dashed var(--primary); box-shadow: none; }
.kanban-card.k-ghost > * { visibility: hidden; }
/* 커서를 따라다니는 요소 (forceFallback: true 라서 시각 반영됨) */
.kanban-card.k-drag { opacity: .92; transform: rotate(1.5deg); cursor: grabbing; }
/* 권한 없어 못 끄는 카드 */
.kanban-card.nodrag { cursor: default; }
.kanban-card { cursor: grab; }
.kanban-card { transition: opacity .12s ease, transform .12s ease; }
/* 담당자가 아니면 드래그 불가 — 끌리는 줄 알고 시도했다 거부되는 혼란 방지(2026-07-16) */
.kanban-card.nodrag { cursor: pointer; }
.kanban-card.nodrag:hover { outline: 1px dashed var(--border); outline-offset: -1px; }
.kanban-col-header { display: flex; align-items: center; gap: .45rem; font-size: .8125rem; font-weight: 600; padding: .25rem .35rem .55rem; color: var(--foreground); }
.kanban-col-header .count { background: var(--background); border: 1px solid var(--border); border-radius: 999px; font-size: .7rem; padding: 0 .4rem; color: var(--muted-foreground); }
.kanban-card {
  background: var(--card); border: 1px solid var(--border); border-radius: .5rem;
  padding: .65rem .7rem; margin-bottom: .5rem; box-shadow: 0 1px 2px rgb(0 0 0 / .05);
  cursor: grab;
}
/* 상태별 카드색(2026-07-22 지상기): 요청=옅주황 · 진행=옅파랑 · 완료=옅초록. 라이트/다크 */
.kanban-card.kb-requested { background:#fdf4e6; border-color:#f0dcb8; }
.kanban-card.kb-doing     { background:#eef2fb; border-color:#cdd9f2; }
.kanban-card.kb-done      { background:#ecf6ee; border-color:#c8e6cf; }
.dark .kanban-card.kb-requested { background:#2a2012; border-color:#4a3a1c; }
.dark .kanban-card.kb-doing     { background:#161f31; border-color:#2a3d5f; }
.dark .kanban-card.kb-done      { background:#132417; border-color:#274b2f; }
/* 아이콘 전용 버튼(자료 목록 보기·다운로드 한 줄, 2026-07-22): 정사각 패딩·아이콘만 */
.iconbtn { padding:.34rem !important; line-height:0; }
.iconbtn svg { display:block; }
.kanban-card .kc-title { font-size: .8125rem; font-weight: 600; margin-bottom: .35rem; color: var(--foreground); }
.kanban-card .kc-meta { display: flex; align-items: center; gap: .4rem; font-size: .7rem; color: var(--muted-foreground); flex-wrap: wrap; }
/* 긴 프로젝트명 배지가 카드를 뚫고 나가지 않게 — 카드 폭 안에서 말줄임(2026-07-07 지시) */
.kanban-card .badge { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 채팅 (Teams 시뮬레이터용) ---------- */
.chat { display: flex; flex-direction: column; gap: .7rem; background: var(--muted); border-radius: .75rem; padding: 1rem; }
.chat-msg { display: flex; gap: .55rem; max-width: 88%; }
.chat-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble { background: var(--card); border: 1px solid var(--border); border-radius: .5rem; padding: .55rem .75rem; font-size: .8125rem; color: var(--foreground); }
.chat-msg.me .chat-bubble { background: var(--primary); color: var(--primary-foreground); border-color: transparent; }
.chat-name { font-size: .7rem; color: var(--muted-foreground); margin-bottom: .2rem; }

.bot-card {
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--primary); border-radius: .5rem;
  padding: .7rem .85rem; font-size: .8125rem; color: var(--foreground);
}
.bot-card .bc-title { font-weight: 700; margin-bottom: .35rem; }
.bot-card .bc-row { display: flex; gap: .5rem; margin: .15rem 0; }
.bot-card .bc-label { color: var(--muted-foreground); min-width: 56px; }
.bot-card .bc-actions { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }

/* ---------- 타임라인 ---------- */
.timeline { position: relative; padding-left: 1.4rem; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 1rem; }
.timeline-item::before {
  content: ""; position: absolute; left: -1.4rem; top: .25rem;
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--background); border: 2px solid var(--primary);
}
.timeline-item.done::before { background: var(--primary); }
.timeline-item.warn::before { border-color: var(--warning); }
.timeline-item.danger::before { border-color: var(--destructive); }
.timeline-item .tl-time { font-size: .7rem; color: var(--muted-foreground); }
.timeline-item .tl-body { font-size: .8125rem; color: var(--foreground); }

/* ---------- 콜아웃 ---------- */
.callout {
  border-radius: .75rem; padding: .75rem 1rem; font-size: .8125rem;
  border: 1px solid var(--border); background: var(--muted);
  display: flex; gap: .6rem; align-items: flex-start; color: var(--foreground);
}
.callout.info { background: var(--info-bg); border-color: color-mix(in oklab, var(--ring) 40%, transparent); }
.callout.success { background: var(--success-bg); border-color: color-mix(in oklab, var(--success) 40%, transparent); }
.callout.warning { background: var(--warning-bg); border-color: color-mix(in oklab, var(--warning) 40%, transparent); }
.callout .co-icon { flex-shrink: 0; }
.callout b { display: block; margin-bottom: .15rem; }

/* ---------- 캘린더 ---------- */
.calendar { border: 1px solid var(--border); border-radius: .75rem; overflow: hidden; }
.calendar-head, .calendar-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-head div {
  padding: .4rem; text-align: center; font-size: .7rem; font-weight: 600;
  color: var(--muted-foreground); background: var(--muted); border-bottom: 1px solid var(--border);
}
.calendar-cell {
  min-height: 86px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: .3rem; font-size: .7rem;
}
.calendar-row .calendar-cell:last-child { border-right: none; }
.calendar-row:last-child .calendar-cell { border-bottom: none; }
.calendar-cell .day { color: var(--muted-foreground); margin-bottom: .2rem; }
.calendar-cell.today { background: var(--info-bg); }
.calendar-cell.today .day { color: var(--primary); font-weight: 700; }
.calendar-cell.dim { background: var(--muted); opacity: .55; }
.cal-event {
  border-radius: 4px; padding: .08rem .35rem; margin-bottom: .15rem;
  font-size: .65rem; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: var(--info-bg); color: var(--primary); border-left: 2px solid var(--primary);
  cursor: pointer;
}
.cal-event.green { background: var(--success-bg); color: var(--success); border-left-color: var(--success); }
.cal-event.amber { background: var(--warning-bg); color: var(--warning); border-left-color: var(--warning); }
.cal-event.red { background: color-mix(in oklab, var(--destructive) 10%, transparent); color: var(--destructive); border-left-color: var(--destructive); }

/* ---------- 보충 유틸리티 ----------
   운영 CSS 번들은 실 앱에서 "사용된" Tailwind 클래스만 포함한다.
   목업에서 쓰지만 번들에 없는 클래스는 여기서 동일 정의로 보충한다.
   (추가 전 반드시 app.css에 없는지 확인할 것) */
.hidden { display: none !important; }
.max-w-2xl { max-width: 42rem; }
.w-7 { width: 1.75rem; }
.h-7 { height: 1.75rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }

/* ---------- 기타 ---------- */
.muted { color: var(--muted-foreground); }
.section-title { font-size: 1.05rem; font-weight: 700; margin: 2rem 0 .75rem; display: flex; align-items: center; gap: .5rem; color: var(--foreground); }
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; border: none; }

kbd {
  font-family: var(--font-mono); font-size: .7rem;
  background: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; padding: .05rem .35rem; color: var(--foreground);
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
