/* =====================================================================
   닥터링크 리뉴얼 공통 컴포넌트 (유지보수 2.0 / AI 스튜디오)
   ===================================================================== */
:root {
	--st-navy: #1f3b6e; --st-blue: #2f80ed; --st-mint: #1bb5a6; --st-orange: #f2994a;
	--st-red: #e5484d; --st-green: #27ae60; --st-gray: #8a94a6; --st-line: #e3e8ef; --st-bg: #f6f8fb;
}

/* 빈 상태 */
.st-empty { width: 100%; padding: 48px 20px; text-align: center; color: #6b7280; background: var(--st-bg); border-radius: 12px; }
.st-empty .material-symbols-outlined { font-size: 40px; color: #b6bfcc; display: block; margin-bottom: 8px; }
.st-empty p { font-size: 15px; line-height: 1.6; }
.st-empty .st-btn { margin-top: 16px; }

/* 버튼 */
.st-btn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--st-line);
	background: #fff; color: #222; font-size: 15px; cursor: pointer; text-decoration: none; transition: .15s; }
.st-btn:hover { border-color: #b9c2cf; }
.st-btn.primary { background: var(--st-navy); border-color: var(--st-navy); color: #fff; }
.st-btn.mint { background: var(--st-mint); border-color: var(--st-mint); color: #fff; }
.st-btn.orange { background: var(--st-orange); border-color: var(--st-orange); color: #fff; }
.st-btn.ghost { background: transparent; }
.st-btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.st-btn[disabled] { opacity: .5; cursor: not-allowed; }

/* 상태 배지 */
.req-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.req-badge.st-gray { background: #eef1f5; color: #5b6575; }
.req-badge.st-blue { background: #e7f0fd; color: #1f63c6; }
.req-badge.st-orange { background: #fff1e4; color: #c26a12; }
.req-badge.st-green { background: #e5f6ec; color: #1d8a4b; }
.req-badge.st-red { background: #fde9ea; color: #c5282e; }

/* 대시보드 요약 */
.req-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 10px 0 24px; }
.req-summary a { display: block; padding: 18px; border: 1px solid var(--st-line); border-radius: 12px; background: #fff; text-decoration: none; color: #222; }
.req-summary a.on { border-color: var(--st-navy); box-shadow: 0 0 0 1px var(--st-navy) inset; }
.req-summary em { display: block; font-style: normal; font-size: 14px; color: #6b7280; }
.req-summary strong { display: block; font-size: 28px; margin-top: 4px; }
.req-summary .warn strong { color: var(--st-orange); }
.req-alert { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-radius: 12px;
	background: #fff7ef; border: 1px solid #ffd9b5; margin-bottom: 12px; font-size: 15px; }
.req-alert b { color: #c26a12; }

/* 요청 카드 목록 */
.req-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.req-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.req-tabs a { padding: 7px 14px; border-radius: 20px; background: #f1f4f8; color: #44506a; font-size: 14px; text-decoration: none; }
.req-tabs a.on { background: var(--st-navy); color: #fff; }
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-card { display: grid; grid-template-columns: 110px 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid var(--st-line);
	border-radius: 12px; background: #fff; text-decoration: none; color: #222; transition: .15s; }
.req-card:hover { border-color: #b9c2cf; box-shadow: 0 4px 14px rgba(20, 40, 80, .06); }
.req-card .cat { font-size: 13px; color: #6b7280; display: flex; align-items: center; gap: 4px; }
.req-card .tit { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-card .meta { font-size: 13px; color: #8a94a6; margin-top: 4px; }
.req-card .mini-steps { display: flex; gap: 4px; margin-top: 8px; }
.req-card .mini-steps i { width: 28px; height: 4px; border-radius: 2px; background: #e3e8ef; }
.req-card .mini-steps i.on { background: var(--st-blue); }
.req-card .mini-steps i.hold { background: var(--st-red); }

/* 스텝퍼 */
.req-stepper { display: flex; list-style: none; padding: 0; margin: 24px 0; counter-reset: s; }
.req-stepper li { flex: 1; position: relative; text-align: center; padding-top: 30px; font-size: 14px; color: #9aa3b2; }
.req-stepper li:before { content: ''; position: absolute; top: 10px; left: -50%; width: 100%; height: 3px; background: #e3e8ef; z-index: 0; }
.req-stepper li:first-child:before { display: none; }
.req-stepper .dot { position: absolute; top: 2px; left: 50%; margin-left: -10px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid #d5dbe4; z-index: 1; box-sizing: border-box; }
.req-stepper strong { display: block; font-weight: 600; }
.req-stepper em { display: block; font-style: normal; font-size: 12px; margin-top: 2px; }
.req-stepper b { display: block; color: var(--st-red); font-size: 12px; }
.req-stepper li.done { color: #2b3445; }
.req-stepper li.done .dot { background: var(--st-blue); border-color: var(--st-blue); }
.req-stepper li.done:before, .req-stepper li.current:before, .req-stepper li.hold:before { background: var(--st-blue); }
.req-stepper li.current { color: var(--st-navy); }
.req-stepper li.current .dot { border-color: var(--st-blue); box-shadow: 0 0 0 5px rgba(47, 128, 237, .18); }
.req-stepper li.hold { color: var(--st-red); }
.req-stepper li.hold .dot { border-color: var(--st-red); }

/* 상세 */
.req-detail { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.req-box { border: 1px solid var(--st-line); border-radius: 12px; background: #fff; padding: 22px; margin-bottom: 16px; }
.req-box h3 { font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.req-body { font-size: 15px; line-height: 1.75; word-break: break-all; }
.req-body img { max-width: 100%; height: auto; }
.req-files li { padding: 6px 0; border-bottom: 1px dashed var(--st-line); font-size: 14px; }
.req-files a { color: var(--st-blue); }
.req-info dt { font-size: 13px; color: #8a94a6; margin-top: 10px; }
.req-info dd { font-size: 15px; margin: 2px 0 0; }

/* 타임라인 */
.req-timeline { list-style: none; padding: 0; margin: 0; }
.req-timeline li { position: relative; padding: 0 0 18px 26px; }
.req-timeline li:before { content: ''; position: absolute; left: 6px; top: 6px; bottom: -6px; width: 2px; background: #e8ecf2; }
.req-timeline li:last-child:before { display: none; }
.req-timeline li:after { content: ''; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #cfd6e1; }
.req-timeline li.client:after { background: var(--st-mint); }
.req-timeline li.staff:after { background: var(--st-navy); }
.req-timeline li.ai:after { background: #8b5cf6; }
.req-timeline li.internal { opacity: .75; }
.req-timeline .who { font-size: 13px; color: #6b7280; }
.req-timeline .msg { font-size: 15px; line-height: 1.6; margin-top: 4px; white-space: pre-wrap; word-break: break-all; }
.req-timeline .msg img { max-width: 100%; }

/* 시안 확인 */
.req-review { border: 2px solid var(--st-orange); background: #fffaf4; }
.req-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.req-preview figure { margin: 0; border: 1px solid var(--st-line); border-radius: 8px; overflow: hidden; background: #fff; }
.req-preview img { display: block; width: 100%; height: auto; }
.req-preview figcaption { font-size: 13px; padding: 6px 10px; color: #6b7280; }

/* 작성 폼 */
.req-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.req-cats label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 8px; border: 1px solid var(--st-line); border-radius: 12px; cursor: pointer; font-size: 14px; text-align: center; background: #fff; }
.req-cats label .material-symbols-outlined { font-size: 30px; color: var(--st-navy); }
.req-cats input { position: absolute; opacity: 0; pointer-events: none; }
.req-cats input:checked + label { border-color: var(--st-navy); box-shadow: 0 0 0 2px var(--st-navy) inset; background: #f4f7fc; }
.req-form .row { margin-bottom: 16px; }
.req-form .row > label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.req-form input[type=text], .req-form input[type=url], .req-form input[type=date], .req-form textarea, .req-form select {
	width: 100%; box-sizing: border-box; border: 1px solid #d5dbe4; border-radius: 8px; padding: 10px 12px; font-size: 15px; font-family: inherit; }
.req-form textarea { min-height: 160px; line-height: 1.6; }
.req-form .hint { font-size: 13px; color: #6b7280; margin-top: 6px; }
.req-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.req-form .actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }

/* AI 패널 (프리미엄 편집기) */
.ai-panel { margin: 0 30px 10px; padding: 16px; border-radius: 12px; background: linear-gradient(135deg, #f4f1ff, #eef6ff); border: 1px solid #ddd5ff; }
.ai-panel h3 { font-size: 15px; display: flex; align-items: center; gap: 6px; margin-bottom: 10px; color: #4c3bb5; }
.ai-panel textarea, .ai-panel input[type=text], .ai-panel select { width: 100%; box-sizing: border-box; border: 1px solid #d6d0f5; border-radius: 8px; padding: 8px 10px; font-size: 14px; font-family: inherit; background: #fff; }
.ai-panel textarea { min-height: 64px; }
.ai-panel .ai-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ai-panel button { flex: 1; min-width: 120px; height: 36px; border: 0; border-radius: 8px; background: #6d5ce8; color: #fff; font-size: 14px; cursor: pointer; }
.ai-panel button.sub { background: #fff; color: #4c3bb5; border: 1px solid #cfc6ff; }
.ai-panel button[disabled] { opacity: .5; cursor: wait; }
.ai-panel .ai-msg { font-size: 13px; margin-top: 8px; color: #555; line-height: 1.5; }
.ai-panel .ai-msg.err { color: var(--st-red); }
.ai-images { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.ai-images img { width: 100%; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.ai-images img:hover { border-color: #6d5ce8; }

/* 레이어 */
#st_layer_wrap { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 9999; display: flex; align-items: center; justify-content: center; }
#st_layer_wrap .st-layer-in { background: #fff; width: min(760px, 92vw); max-height: 86vh; overflow: auto; border-radius: 12px; padding: 24px; position: relative; }

@media (max-width: 900px) {
	.req-detail { grid-template-columns: 1fr; }
	.req-summary { grid-template-columns: repeat(2, 1fr); }
	.req-cats { grid-template-columns: repeat(2, 1fr); }
	.req-card { grid-template-columns: 1fr; gap: 6px; }
	.req-form .two { grid-template-columns: 1fr; }
	.req-stepper li { font-size: 12px; }
}
