/* AI프리너 — 오피스 앱 화면 */

.app-body { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

/* 헤더 */
.app-header {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px;
  background: var(--brown-dark);
  color: #f5e6c8;
  border-bottom: 4px solid var(--gold);
  flex-shrink: 0;
}
.logo { font-size: 1.5rem; color: #f5e6c8; letter-spacing: 1px; }
.logo-mark { color: var(--gold); }
.header-center { display: flex; gap: 12px; margin-left: auto; }
.cost-box {
  display: flex; flex-direction: column; align-items: flex-end;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(201,162,39,.5);
  border-radius: 8px; padding: 4px 14px; min-width: 150px;
}
.cost-box .cost-label { font-size: .78rem; opacity: .8; }
.cost-box b { font-size: 1.15rem; color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.cost-box.burning b, .cost-box .burning { color: #ffb35c; }
.header-right { display: flex; align-items: center; gap: 12px; margin-left: 8px; }
.trial-pill {
  background: var(--green); color: #fff;
  padding: 6px 14px; border-radius: 999px; font-size: .92rem;
  border: 2px solid rgba(255,255,255,.35);
  white-space: nowrap;
}

/* 본문 레이아웃 */
.app-main { flex: 1; display: flex; gap: 14px; padding: 14px; min-height: 0; }

.office-wrap {
  flex: 1.4; display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
#officeCanvas {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #10182c;
  border: 4px solid var(--brown);
  border-radius: 12px;
  box-shadow: var(--shadow);
  image-rendering: pixelated;
  cursor: pointer;
  min-height: 0;
}
.office-hint { text-align: center; color: var(--ink-soft); font-size: .95rem; flex-shrink: 0; }

/* 우측 패널 */
.panel {
  width: 430px; flex-shrink: 0;
  background: var(--panel);
  border: 3px solid var(--brown-dark);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.tabs { display: flex; border-bottom: 3px solid var(--brown-dark); flex-shrink: 0; }
.tab-btn {
  flex: 1; padding: 13px 4px;
  background: var(--panel-deep); border: none; border-right: 2px solid var(--brown-dark);
  font-family: var(--font-pixel); font-size: 1.02rem; color: var(--ink-soft);
  cursor: pointer; position: relative;
}
.tab-btn:last-child { border-right: none; }
.tab-btn.active { background: var(--panel); color: var(--ink); }
.tab-btn.pulse { animation: pulse 0.6s ease 4; }
@keyframes pulse { 50% { background: rgba(232,193,90,.25); } }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: .82rem; margin-left: 2px;
}

.tab-panel { display: none; flex: 1; flex-direction: column; padding: 14px; min-height: 0; overflow-y: auto; }
.tab-panel.active { display: flex; }
.panel-title { font-size: 1.25rem; margin-bottom: 6px; }
.panel-sub { color: var(--ink-soft); font-size: .95rem; margin-bottom: 12px; }

.scroll-area { overflow-y: auto; min-height: 90px; }
.scroll-area.tall { flex: 1; }

/* 진행 중 작업 */
.task-row { padding: 10px 4px; border-bottom: 1px dashed #263356; }
.task-title { font-weight: 700; font-size: 1.02rem; }
.task-meta { color: var(--ink-soft); font-size: .88rem; margin: 2px 0 6px; }
.bar { height: 12px; background: var(--panel-deep); border-radius: 999px; border: 2px solid var(--brown); overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); border-radius: 999px; transition: width .2s linear; }
.bar-fill.wait { background: var(--gold); }

/* 지시 입력 */
.order-box { border-top: 3px solid var(--brown-dark); margin-top: 10px; padding-top: 12px; flex-shrink: 0; }
.order-guide { font-size: .95rem; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  background: #1a2340; border: 2px solid #33436f; border-radius: 999px;
  padding: 4px 12px; font-size: .85rem; color: var(--ink-soft); cursor: pointer;
}
.chip:hover { background: rgba(232,193,90,.18); color: var(--ink); }
#orderForm { display: flex; gap: 8px; align-items: stretch; }
#orderInput {
  flex: 1; resize: none; font-family: var(--font-body); font-size: 1.05rem;
  padding: 10px 12px; border: 3px solid var(--brown); border-radius: 8px; background: var(--panel-deep); color: var(--ink);
}
.big-btn { font-size: 1.15rem; padding: 10px 20px; }

.done-box { margin-top: 12px; flex-shrink: 0; }
.done-box h3 { font-size: 1rem; color: var(--ink-soft); margin-bottom: 4px; }
.done-row { font-size: .95rem; padding: 4px 2px; }

/* 결재함 */
.inbox-card {
  border: 3px solid var(--brown-dark); border-radius: 10px;
  background: #16203a; margin-bottom: 14px; padding: 12px;
  box-shadow: 0 3px 0 rgba(0,0,0,.4);
}
.inbox-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.inbox-title { font-weight: 800; font-size: 1.08rem; }
.risk-tag {
  background: rgba(63,208,138,.12); color: var(--green); border: 2px solid var(--green);
  font-size: .78rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.deliv { background: var(--panel-deep); border-radius: 8px; padding: 10px; font-size: .97rem; margin-bottom: 8px; }
.note { font-size: .9rem; color: var(--ink-soft); margin-bottom: 4px; }
.note.prev-fb { color: var(--red); }
.cost-line { font-size: .92rem; margin: 8px 0; }
.fb-input {
  width: 100%; min-height: 54px; resize: vertical;
  font-family: var(--font-body); font-size: .98rem;
  border: 2px dashed #3f5590; border-radius: 8px; padding: 8px 10px; background: var(--panel-deep); color: var(--ink);
}
.fb-input.shake { animation: shake .5s; border-color: var(--red); }
@keyframes shake { 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }
.inbox-actions { display: flex; gap: 10px; margin-top: 10px; }
.inbox-actions .approve { flex: 1.4; background: var(--green); color: #0a1a12; }
.inbox-actions .reject { flex: 1; background: #223050; color: var(--ink); }

/* 직원 목록 */
.emp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px; border-bottom: 1px dashed #263356; cursor: pointer;
  border-radius: 8px;
}
.emp-row:hover { background: #1a2542; }
.emp-face {
  width: 46px; height: 46px; border-radius: 10px;
  border: 3px solid var(--brown-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.emp-face.big { width: 64px; height: 64px; font-size: 2rem; }
.emp-info { flex: 1; min-width: 0; }
.emp-name { font-weight: 800; font-size: 1.02rem; }
.emp-title { font-weight: 400; color: var(--ink-soft); font-size: .9rem; }
.badge-core {
  background: rgba(232,193,90,.14); border: 1px solid var(--gold);
  font-size: .72rem; padding: 1px 6px; border-radius: 999px; color: var(--gold);
}
.emp-status { font-size: .88rem; color: var(--ink-soft); }
.emp-row.busy .emp-status { color: var(--green); font-weight: 700; }
.emp-cost { text-align: right; flex-shrink: 0; }
.emp-rate { font-size: .92rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.emp-total { font-size: .8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* 모달 */
.modal { position: fixed; inset: 0; display: none; z-index: 50; }
.modal.open { display: block; }
.modal-bg { position: absolute; inset: 0; background: rgba(2,5,15,.7); }
.modal-card {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: min(520px, 92vw); max-height: 86vh; overflow-y: auto;
  background: var(--panel); border: 4px solid var(--brown); border-radius: 14px;
  box-shadow: 0 8px 0 rgba(0,0,0,.5);
  padding: 22px;
  display: flex; flex-direction: column;
}
.modal-card.wide { width: min(640px, 94vw); }
.modal-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--ink-soft);
}

/* 직원 상세 */
.detail-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.detail-head h3 { font-size: 1.35rem; }
.detail-head small { color: var(--ink-soft); font-size: .95rem; }
.dept-tag { font-size: .9rem; }
.speech {
  background: var(--panel-deep); border: 2px solid var(--brown); border-radius: 10px;
  padding: 12px 14px; font-size: 1.02rem; margin-bottom: 8px;
}
.speech.alt { background: #131c33; border-style: dashed; color: var(--ink-soft); font-size: .95rem; }
.detail-desc { font-size: .97rem; color: var(--ink-soft); margin: 10px 0; }
.detail-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px;
}
.detail-stats > div {
  background: var(--panel-deep); border-radius: 8px; padding: 8px; text-align: center;
  display: flex; flex-direction: column;
}
.stat-label { font-size: .8rem; color: var(--ink-soft); }
.detail-stats b { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* 채용 목록 */
.hire-card {
  display: flex; gap: 12px; align-items: center;
  border: 2px solid #2c3b63; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px;
  background: #16203a;
}
.hire-card.hired { opacity: .6; }
.hire-info { flex: 1; min-width: 0; }
.hire-title { font-weight: 800; font-size: 1.05rem; }
.hire-desc { font-size: .88rem; color: var(--ink-soft); line-height: 1.45; }
.hire-rate { font-size: .88rem; margin-top: 2px; font-weight: 700; }

/* 요금제 (페이월) */
.plan-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.plan {
  display: flex; align-items: center; gap: 10px;
  border: 3px solid var(--brown); border-radius: 10px; padding: 12px 16px;
  background: #16203a;
}
.plan.featured { background: rgba(232,193,90,.12); border-color: var(--gold); }
.plan b { font-size: 1.08rem; flex: 1; }
.plan-tag { background: var(--red); color: #1a0505; font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.plan-tag.save { background: var(--green); }
.plan-price { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: .8rem; color: var(--ink-soft); font-weight: 400; }
.pay-note { font-size: .88rem; color: var(--ink-soft); }

/* 토스트 */
#toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--brown-dark); color: #ffe9b8;
  border: 3px solid var(--gold); border-radius: 12px;
  padding: 12px 22px; font-size: 1.05rem;
  opacity: 0; pointer-events: none; transition: all .25s;
  z-index: 99; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 반응형 */
@media (max-width: 1080px) {
  .app-main { flex-direction: column; overflow-y: auto; }
  .app-body { overflow-y: auto; height: auto; min-height: 100vh; }
  .panel { width: 100%; }
  #officeCanvas { min-height: 320px; }
  .header-center { display: none; }
}

/* 모드 표시 */
.mode-pill {
  font-family: var(--font-pixel);
  background: var(--panel-deep); color: var(--ink-soft);
  padding: 6px 14px; border-radius: 999px; font-size: .92rem;
  border: 2px solid var(--brown); white-space: nowrap;
}
.mode-pill.live { background: rgba(255,107,94,.15); color: #ff9d94; border-color: var(--red); }

/* 결재 결과물 (실전 모드에서 길어질 수 있음) */
.deliv { max-height: 260px; overflow-y: auto; white-space: pre-wrap; }

/* 설정 모달 */
.settings-section { margin-top: 16px; padding-top: 14px; border-top: 2px dashed #263356; }
.settings-section:first-of-type { border-top: none; }
.settings-section h3 { font-size: 1.1rem; margin-bottom: 6px; }
.set-label { display: block; font-size: .88rem; color: var(--ink-soft); margin: 10px 0 4px; }
.set-input {
  width: 100%; font-family: var(--font-body); font-size: .98rem;
  padding: 9px 12px; border: 2px solid var(--brown); border-radius: 8px;
  background: var(--panel-deep); color: var(--ink);
}
.settings-actions { display: flex; gap: 10px; margin-top: 12px; }
#connectMsg { margin-top: 8px; min-height: 1.2em; }
#aiStatus.on { background: rgba(63,208,138,.15); border-color: var(--green); color: var(--green); }

/* 구독/API 카드 */
.sub-card, .api-card {
  display: flex; gap: 12px; align-items: center;
  border: 2px solid #2c3b63; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px; background: #16203a;
}
.sub-card.off { opacity: .6; }
.sub-card.on { border-color: var(--green); }
.sub-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sub-info b { font-size: 1rem; }
.sub-info .dim { font-size: .84rem; line-height: 1.4; }
.api-card { flex-direction: column; align-items: stretch; gap: 6px; }
.api-head { display: flex; align-items: center; gap: 8px; }
.api-head b { flex: 1; font-size: 1rem; }
.api-row { display: flex; gap: 8px; }
.api-row .set-input { flex: 1; }
.api-card.on { border-color: var(--green); }
.status-chip {
  font-size: .75rem; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--brown); color: var(--ink-soft); white-space: nowrap;
}
.status-chip.on { border-color: var(--green); color: var(--green); background: rgba(63,208,138,.12); }
.status-chip.miss { border-color: var(--red); color: #ff9d94; }

/* 팀 */
.team-select {
  width: 100%; margin-bottom: 8px;
  font-family: var(--font-body); font-size: .95rem;
  padding: 8px 10px; border: 2px solid var(--brown); border-radius: 8px;
  background: var(--panel-deep); color: var(--ink);
}
.team-card {
  border: 3px solid var(--brown); border-left-width: 10px; border-radius: 10px;
  background: #16203a; padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
}
.team-card:hover { background: #1a2542; }
.team-card h4 { font-size: 1.08rem; margin-bottom: 4px; }
.team-meta { font-size: .88rem; color: var(--ink-soft); }
.team-tasks { margin-top: 8px; font-size: .9rem; }
.team-tasks .done-row { color: var(--ink-soft); }
.color-pick { display: flex; gap: 8px; margin: 4px 0 6px; }
.color-dot {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent;
}
.color-dot.sel { border-color: #fff; }
.member-pick {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 160px; overflow-y: auto;
  border: 2px dashed #2c3b63; border-radius: 8px; padding: 8px 10px; margin-top: 4px;
}
.member-pick label { display: flex; gap: 8px; align-items: center; font-size: .95rem; cursor: pointer; }
.member-pick .empty { padding: 6px; }
.team-tag {
  display: inline-block; font-size: .74rem; padding: 1px 8px; border-radius: 999px;
  border: 1px solid currentColor; margin-left: 6px; vertical-align: 1px;
}

/* 결재함 이미지 결과물 */
.deliv-img { margin-bottom: 8px; }
.deliv-img img {
  max-width: 100%; border-radius: 8px; border: 2px solid var(--brown); display: block;
}
.deliv-img .img-actions { margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.deliv-img .img-note { font-size: .8rem; color: var(--ink-soft); }

.folder-write { display: flex; gap: 8px; align-items: center; font-size: .92rem; margin-top: 8px; color: var(--ink); cursor: pointer; }
.emp-provider-sel { margin-top: 10px; }

/* 클로드코드 실황 */
.live-log {
  max-height: 340px; overflow-y: auto;
  border: 2px solid var(--brown); border-radius: 10px;
  background: var(--panel-deep); padding: 10px 12px; margin: 10px 0;
}
.log-item { padding: 6px 0; border-bottom: 1px dashed #223050; font-size: .9rem; }
.log-item:last-child { border-bottom: none; }
.log-ts { color: var(--ink-soft); font-size: .78rem; margin-right: 4px; }
.log-text { white-space: pre-wrap; word-break: break-word; color: var(--ink); margin-top: 2px; }
.log-tool .log-text { color: var(--ink-soft); font-size: .84rem; }
.log-user b { color: var(--gold); }
.log-ai b { color: var(--green); }
