:root {
  --green-900: #0a3b29;
  --green-800: #0d4a33;
  --green-700: #0f6b45;
  --green-600: #13804f;
  --green-500: #22a86b;
  --green-100: #e3f5ec;
  --green-50: #f1faf5;
  --ink: #17212b;
  --ink-2: #3f4b57;
  --muted: #7a8794;
  --line: #e6ebf0;
  --bg: #f6f8fa;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .04);

  /* 업무 분야 색상 */
  --c-data: #1d8a52;  --c-data-bg: #e6f6ed;
  --c-doc: #2f6bd6;   --c-doc-bg: #e8f0fd;
  --c-file: #7a4fd6;  --c-file-bg: #f0eafd;
  --c-email: #e08a1e; --c-email-bg: #fdf1e2;
  --c-report: #d6457a; --c-report-bg: #fde8f0;
  --c-program: #4f5fd6; --c-program-bg: #eaecfd;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  word-break: keep-all;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: .5; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }

.ic-green { color: var(--green-600); }
.muted { color: var(--muted); }

/* ───── Layout ───── */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: 0 24px 32px; }

/* ───── Sidebar ───── */
.sidebar {
  width: 236px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--green-800) 0%, var(--green-900) 100%);
  color: #e3efe9;
  padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, #2fbf7a, #13804f);
  display: grid; place-items: center; font-weight: 800; font-size: 19px; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.brand-name { font-weight: 800; font-size: 17px; color: #fff; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: #9fc4b2; margin-top: 1px; }
.nav-group { padding: 4px 0; }
.nav-group + .nav-group { border-top: 1px solid rgba(255,255,255,.07); margin-top: 6px; padding-top: 10px; }
.nav-group-title { font-size: 11px; font-weight: 600; color: #82ab98; padding: 2px 12px 6px; letter-spacing: .02em; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px; font-size: 14px; color: #d6e6de; text-align: left;
  transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); }
.nav-item.active { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #2fbf7a; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

/* ───── Topbar ───── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px; position: sticky; top: 0; z-index: 10;
  background: rgba(246, 248, 250, .88); backdrop-filter: blur(8px);
}
.search {
  flex: 0 1 420px; margin-left: auto; margin-right: auto;
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 19px; background: #fff; color: var(--muted);
}
.search:focus-within { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(34,168,107,.12); }
.search input { flex: 1; border: 0; outline: 0; background: none; font-size: 13px; color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.help-btn { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 16px; background: #eef1f4; font-size: 13px; font-weight: 500; }
.icon-btn { position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: #eef1f4; }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: #2fbf7a; border: 2px solid var(--bg); }
.divider { width: 1px; height: 22px; background: var(--line); }
.profile { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 10px; }
.profile:hover { background: #eef1f4; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #dfe5ea; display: grid; place-items: center; color: #6b7783; }
.profile-text { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.profile-text strong { font-size: 13px; }
.profile-text small { font-size: 11px; color: var(--muted); }

/* ───── Home ───── */
.home { display: flex; flex-direction: column; gap: 18px; max-width: 1240px; margin: 0 auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Hero */
.hero {
  position: relative; display: flex; align-items: center;
  min-height: 250px; padding: 24px 32px; border-radius: 18px; overflow: hidden;
  background: #effaf7 url('../images/hero-bg.webp') no-repeat;
  background-size: cover;
  background-position: right 48%;
}
@media (min-width: 1280px) {
  /* 넓은 화면: 일러스트 전체(파일 아이콘 포함)가 잘리지 않도록 높이 기준으로 맞춤 */
  .hero { background-size: auto 240%; background-position: right -10px top 42%; }
}
.hero-text { position: relative; z-index: 1; max-width: 560px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 14px;
  background: var(--green-700); color: #fff; font-size: 12px; font-weight: 600;
}
.hero h1 { margin-top: 14px; font-size: 34px; line-height: 1.28; font-weight: 800; letter-spacing: -0.03em; }
.hero h1 .accent { color: var(--green-700); }
.hero p { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; }

/* Quick start: 작업 파일 + 업무 과정 설명 */
.quick { padding: 18px 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2, .section-head h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; }
.card-sub { margin: 4px 0 0 26px; font-size: 13px; color: var(--muted); }

.quick-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 14px; }
.q-step { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfdfd; }
.q-step-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.q-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--green-700); color: #fff; font-size: 12px; font-weight: 700; }
.q-count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

.slots { display: flex; flex-direction: column; gap: 8px; }
.slot {
  padding: 10px 12px; border: 1.5px dashed #cfd8df; border-radius: 10px; background: #fff;
  transition: border-color .15s, background .15s;
}
.slot.dragging { border-color: var(--green-500); background: var(--green-50); }
.slot.filled { border-style: solid; border-color: var(--green-100); background: var(--green-50); }
.slot-main { display: flex; align-items: center; gap: 10px; }
.slot-ic { flex-shrink: 0; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--green-50); color: var(--green-600); }
.slot-ic.after { background: #eef4fe; color: #2f6bd6; }
.slot.filled .slot-ic { background: #fff; }
.slot-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.slot-text strong { font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.slot-text small { font-size: 12px; color: var(--muted); }
.slot-text em { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.slot-text em.req { background: #fdecec; color: #d64545; }
.slot-text em.opt { background: #eef1f4; color: var(--ink-2); }
.slot-files { display: flex; flex-wrap: wrap; gap: 6px; }
.slot-files:not(:empty) { margin-top: 8px; padding-left: 48px; }
.btn-outline {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--green-700); white-space: nowrap;
}
.btn-outline:hover { background: var(--green-50); border-color: var(--green-100); }

.formats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fmt { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--ink-2); background: #fff; }
.fmt i { width: 9px; height: 11px; border-radius: 2px; }
.fmt-hint { font-size: 11.5px; color: var(--muted); margin-left: 2px; }

#desc {
  flex: 1; min-height: 150px; resize: vertical; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fff;
  font-size: 13.5px; line-height: 1.6;
}
#desc:focus { border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(34,168,107,.12); }
#desc::placeholder { color: #a2adb8; }
.examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ex-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-right: 2px; }
.examples button { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: 12px; color: var(--ink-2); }
.examples button:hover { border-color: var(--green-100); background: var(--green-50); color: var(--green-700); }

.quick-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid #f1f3f5; }
.foot-note { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.foot-note svg { color: var(--green-600); }
.foot-status { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.foot-status.ready { color: var(--green-700); font-weight: 600; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 20px; border-radius: 9px;
  background: var(--green-700); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background .15s;
}
.btn-primary:hover:not(:disabled) { background: var(--green-800); }
.file-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: 13px; background: #fff; border: 1px solid var(--green-100); color: var(--green-700); font-size: 12px; font-weight: 500; max-width: 100%; }
.file-chip button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.file-chip button:hover { background: rgba(0,0,0,.06); }

@media (max-width: 960px) {
  .quick-grid { grid-template-columns: 1fr; }
  .foot-status { margin-left: 0; }
  .quick-foot .btn-primary { width: 100%; justify-content: center; }
}

/* Categories */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--green-700); }
.link.sm { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.link:hover { text-decoration: underline; }
.cat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.cat {
  --c: var(--c-data); --bg2: var(--c-data-bg);
  position: relative; display: flex; align-items: flex-start; gap: 9px; min-height: 112px;
  padding: 13px 10px 34px; border-radius: 12px; text-align: left; overflow: hidden;
  background: linear-gradient(160deg, #fff 30%, var(--bg2) 140%);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cat:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 35%, var(--line)); box-shadow: 0 6px 18px rgba(16,24,40,.08); }
.cat-ic { flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--bg2); color: var(--c); }
.cat-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-right: 12px; position: relative; z-index: 1; }
.cat-body strong { font-size: 13px; font-weight: 700; }
.cat-body small { font-size: 11px; color: var(--muted); line-height: 1.35; }
.cat-arrow { position: absolute; top: 14px; right: 8px; color: var(--ink-2); }
.cat-art { position: absolute; right: 6px; bottom: 0; width: 54px; height: 32px; color: var(--c); opacity: .9; }
.cat-art svg { width: 100%; height: 100%; }
.cat-data, .tpl-ic.cat-data, .tag.cat-data { --c: var(--c-data); --bg2: var(--c-data-bg); }
.cat-doc, .tpl-ic.cat-doc, .tag.cat-doc { --c: var(--c-doc); --bg2: var(--c-doc-bg); }
.cat-file, .tpl-ic.cat-file, .tag.cat-file { --c: var(--c-file); --bg2: var(--c-file-bg); }
.cat-email, .tpl-ic.cat-email, .tag.cat-email { --c: var(--c-email); --bg2: var(--c-email-bg); }
.cat-report, .tpl-ic.cat-report, .tag.cat-report { --c: var(--c-report); --bg2: var(--c-report-bg); }
.cat-program, .tpl-ic.cat-program, .tag.cat-program { --c: var(--c-program); --bg2: var(--c-program-bg); }

/* Bottom panels */
.bottom-grid { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 14px; }
.panel { padding: 16px 18px; display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h3 { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 700; }
.tpl-list li { display: flex; align-items: center; gap: 9px; padding: 8px 0; }
.tpl-list li + li { border-top: 1px solid #f1f3f5; }
.tpl-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--bg2); color: var(--c); flex-shrink: 0; }
.tpl-title { font-size: 13px; font-weight: 500; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { padding: 2px 7px; border-radius: 5px; font-size: 10.5px; font-weight: 600; background: var(--bg2); color: var(--c); flex-shrink: 0; }
.use-btn { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--green-700); flex-shrink: 0; }
.use-btn:hover { background: var(--green-50); border-color: var(--green-100); }
.period { height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; background: #fff; color: var(--ink-2); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { display: flex; gap: 8px; padding: 10px; border-radius: 10px; }
.kpi > svg { margin-top: 2px; flex-shrink: 0; }
.kpi small { display: block; font-size: 11px; color: var(--ink-2); font-weight: 500; }
.kpi strong { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.kpi em { font-style: normal; font-size: 13px; font-weight: 600; margin-left: 1px; }
.k-green { background: var(--green-50); color: var(--green-700); }
.k-blue { background: #eef4fe; color: #2f6bd6; }
.k-purple { background: #f3effd; color: #6a45c9; }
.line-chart { width: 100%; height: auto; margin-top: 8px; }
.line-chart .axis { font-size: 8.5px; fill: var(--muted); }
.run-list li { display: flex; align-items: center; gap: 9px; padding: 9px 0; }
.run-list li + li { border-top: 1px solid #f1f3f5; }
.run-list .ok { color: var(--green-500); flex-shrink: 0; }
.run-list .fail { color: #e5484d; flex-shrink: 0; }
.run-title { flex: 1; font-size: 13px; font-weight: 500; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-time { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }

/* Placeholder */
.placeholder { max-width: 1240px; margin: 40px auto; padding: 60px 20px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.placeholder h2 { margin: 12px 0 6px; color: var(--ink); font-size: 20px; }
.placeholder p { margin: 0; font-size: 14px; }

/* Assistant */
.fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 30;
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 14px; border-radius: 23px;
  background: var(--green-700); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(13, 74, 51, .3);
}
.fab:hover { background: var(--green-800); }
.assistant {
  position: fixed; right: 24px; bottom: 82px; z-index: 30;
  width: 360px; max-height: min(520px, calc(100vh - 120px)); display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 48px rgba(16,24,40,.18); overflow: hidden;
}
.as-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.as-head strong { flex: 1; font-size: 14px; }
.as-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--green-100); color: var(--green-700); }
.as-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #fafbfc; }
.bubble { max-width: 85%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.bubble.ai { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-top-left-radius: 4px; }
.bubble.user { background: var(--green-700); color: #fff; align-self: flex-end; border-top-right-radius: 4px; }
.as-sugs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.as-sugs button { padding: 6px 10px; border: 1px solid var(--green-100); border-radius: 14px; background: #fff; font-size: 12px; color: var(--green-700); }
.as-sugs button:hover { background: var(--green-50); }
.as-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.as-input input { flex: 1; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 18px; outline: 0; font-size: 13px; }
.as-input input:focus { border-color: var(--green-500); }
.as-input button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--green-700); color: #fff; }

/* ───── Responsive ───── */
@media (max-width: 1280px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .bottom-grid { grid-template-columns: 1fr 1fr; }
  .bottom-grid > :nth-child(2) { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .hero { min-height: 0; padding: 22px 20px 150px; align-items: flex-start; background-size: 560px auto; background-position: right -10px bottom -97px; }
  .hero h1 { font-size: 26px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-grid { grid-template-columns: 1fr; }
  .topbar .help-btn, .profile-text { display: none; }
  .content { padding: 0 16px 90px; }
  .assistant { left: 16px; right: 16px; width: auto; }
}
