/* SC Group 사장실 — Toss-style design tokens */

/* Pretendard v1.3.9 (SIL OFL 1.1, /static/fonts/LICENSE.txt) — 자체 호스팅 서브셋 */
@font-face { font-family: "Pretendard"; font-weight: 400; font-style: normal; font-display: swap; src: local("Pretendard Regular"), local("Pretendard-Regular"), url("/static/fonts/Pretendard-Regular.subset.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 500; font-style: normal; font-display: swap; src: local("Pretendard Medium"), local("Pretendard-Medium"), url("/static/fonts/Pretendard-Medium.subset.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 600; font-style: normal; font-display: swap; src: local("Pretendard SemiBold"), local("Pretendard-SemiBold"), url("/static/fonts/Pretendard-SemiBold.subset.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 700 800; font-style: normal; font-display: swap; src: local("Pretendard Bold"), local("Pretendard-Bold"), url("/static/fonts/Pretendard-Bold.subset.woff2") format("woff2"); }

:root {
  /* palette */
  --blue-500: #3182f6;
  --blue-600: #1b64da;
  --blue-400: #4593fc;
  --blue-100: #c9e2ff;
  --blue-050: #e8f3ff;
  --grey-900: #191f28;
  --grey-800: #333d4b;
  --grey-700: #4e5968;
  --grey-600: #6b7684;
  --grey-500: #8b95a1;
  --grey-400: #b0b8c1;
  --grey-300: #d1d6db;
  --grey-200: #e5e8eb;
  --grey-100: #f2f4f6;
  --grey-050: #f9fafb;

  /* semantic (기존 변수명 유지 → 토스 팔레트로 매핑) */
  --bg: var(--grey-100);
  --bg-marble: none;
  --surface: #ffffff;
  --surface-2: var(--grey-050);
  --line: var(--grey-200);
  --line-strong: var(--grey-300);
  --text: var(--grey-900);
  --text-2: var(--grey-700);
  --muted: var(--grey-500);
  --navy: var(--blue-500);
  --navy-600: var(--blue-600);
  --navy-050: var(--blue-050);
  --ok: #03b26c;
  --ok-bg: #e5f8ef;
  --warn: #e08a00;
  --warn-bg: #fff4e0;
  --err: #f04452;
  --err-bg: #ffeeee;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 3px rgba(0, 27, 55, .04);
  --shadow-lg: 0 8px 28px rgba(0, 27, 55, .10);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.6; letter-spacing: -.01em; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
a { color: var(--blue-500); text-decoration: none; }
a:hover { color: var(--blue-600); }
h1, h2, h3 { margin: 0; color: var(--text); letter-spacing: -.02em; }
h1 { font-size: 26px; font-weight: 700; line-height: 1.35; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
h3 small { font-weight: 500; font-size: 14px; color: var(--muted); margin-left: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
.inline { display: inline; margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue-400); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 18px; border-radius: 12px; border: 0; font: inherit; font-weight: 600; font-size: 15px; letter-spacing: -.01em; cursor: pointer; text-decoration: none !important; transition: background .2s var(--ease), color .2s var(--ease), transform .12s var(--ease); user-select: none; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; height: 54px; font-size: 16px; border-radius: 14px; }
.btn-primary { background: var(--blue-500); color: #fff; }
.btn-primary:hover { background: var(--blue-600); color: #fff; }
.btn-primary:disabled { background: var(--blue-100); color: #fff; cursor: not-allowed; }
.btn-ghost { background: var(--grey-100); color: var(--grey-700); }
.btn-ghost:hover { background: var(--grey-200); color: var(--grey-800); }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #d22030; }
.btn-danger-ghost { background: var(--err-bg); color: var(--err); }
.btn-danger-ghost:hover { background: #ffdcdc; }
.icon-btn { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--grey-700); width: 40px; height: 40px; border-radius: 10px; transition: background .2s; }
.icon-btn:hover { background: var(--grey-100); }

/* auth */
body.auth { display: grid; place-items: center; padding: 20px; background: var(--grey-100); }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 40px 28px 32px; display: grid; gap: 16px; }
.auth-card h1 { font-size: 24px; }
.auth-card form { display: grid; gap: 16px; margin-top: 4px; }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.auth-brand strong { display: block; font-size: 17px; font-weight: 700; }
.auth-brand span { color: var(--muted); font-size: 13px; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; color: var(--grey-600); }
input, textarea, select { font: inherit; font-size: 16px; color: var(--text); background: var(--grey-100); border: 1.5px solid transparent; border-radius: 12px; padding: 13px 14px; width: 100%; transition: border-color .2s, background .2s; }
input::placeholder, textarea::placeholder { color: var(--grey-400); }
input:hover, textarea:hover, select:hover { background: var(--grey-200); }
input:focus, textarea:focus, select:focus { outline: none; background: var(--surface); border-color: var(--blue-500); }
input.otp { letter-spacing: .45em; font-size: 26px; font-weight: 700; text-align: center; padding: 16px 14px; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-info { background: var(--blue-050); color: var(--blue-600); }

/* shell */
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--blue-500); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .02em; }
.brand-mark.lg { width: 44px; height: 44px; font-size: 16px; border-radius: 13px; }
.topbar { position: sticky; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 10px; padding: 0 20px; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid rgba(0, 27, 55, .06); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand:hover { color: var(--text); }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { color: var(--muted); font-weight: 500; font-size: 14px; padding-left: 10px; border-left: 1px solid var(--grey-300); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 13px; }
.who { color: var(--grey-700); font-weight: 600; }
.conn { display: inline-flex; align-items: center; gap: 6px; color: var(--grey-600); background: var(--grey-100); padding: 5px 10px; border-radius: 99px; font-weight: 500; }
.conn i { width: 7px; height: 7px; border-radius: 50%; background: var(--grey-400); }
.conn[data-state="online"] i { background: var(--ok); box-shadow: 0 0 0 3px rgba(3, 178, 108, .18); }
.conn[data-state="offline"] i { background: var(--err); }
.nav-toggle { display: none; }
.layout { display: flex; min-height: calc(100vh - 60px); }
.sidebar { width: 232px; flex: none; background: transparent; padding: 20px 12px; display: flex; flex-direction: column; }
.sidebar ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sidebar a { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-radius: 12px; color: var(--grey-700); font-weight: 600; font-size: 15px; text-decoration: none; transition: background .2s, color .2s, transform .12s var(--ease); }
.sidebar a:hover { background: rgba(0, 27, 55, .05); color: var(--grey-900); }
.sidebar a:active { transform: scale(.97); }
.sidebar a.active { background: var(--surface); color: var(--blue-500); box-shadow: var(--shadow); }
.sidebar em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--grey-500); background: var(--grey-200); border-radius: 6px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; font-size: 12px; color: var(--grey-400); padding: 12px 14px; }
.scrim { display: none; }
.main { flex: 1; min-width: 0; padding: 28px 28px 40px 12px; display: grid; gap: 20px; align-content: start; max-width: 1440px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 4px 4px 0; }
.page-head p { margin: 4px 0 0; font-size: 15px; }
.actions { display: flex; gap: 8px; }

.card { background: var(--surface); border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-head a { font-weight: 600; color: var(--grey-500); }
.card-head a:hover { color: var(--blue-500); }
.card.empty { text-align: center; padding: 56px 16px; color: var(--muted); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); display: grid; gap: 6px; }
.stat span { font-size: 14px; color: var(--grey-600); font-weight: 500; }
.stat strong { font-size: 28px; font-weight: 700; color: var(--grey-900); letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat:nth-child(3) strong { color: var(--blue-500); }
.stat-worker strong { font-size: 17px; padding-top: 8px; display: inline-flex; align-items: center; gap: 8px; }
.stat-worker strong::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--grey-400); flex: none; }
.stat-worker strong[data-state="online"] { color: var(--ok); }
.stat-worker strong[data-state="online"]::before { background: var(--ok); }
.stat-worker strong[data-state="busy"] { color: var(--blue-500); }
.stat-worker strong[data-state="busy"]::before { background: var(--blue-500); }
.stat-worker strong[data-state="offline"], .stat-worker strong[data-state="auth"] { color: var(--err); }
.stat-worker strong[data-state="offline"]::before, .stat-worker strong[data-state="auth"]::before { background: var(--err); }

/* 사장실 상단 4지표 · 브리핑 */
.stats.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
a.stat-link { color: inherit; text-decoration: none; transition: transform .12s var(--ease), box-shadow .2s; }
a.stat-link:hover { color: inherit; box-shadow: 0 4px 16px rgba(0, 27, 55, .08); }
a.stat-link:active { transform: scale(.98); }
.stat-alert.warn strong { color: var(--warn); }
.stat-alert.danger strong { color: var(--err); }
.stat-alert.danger { box-shadow: inset 0 0 0 1.5px rgba(240, 68, 82, .35), var(--shadow); }
.briefing .card-head { margin-bottom: 4px; }
.brief-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.brief-list li { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--grey-100); font-size: 15px; color: var(--grey-800); flex-wrap: wrap; }
.brief-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.brief-list li b { flex: none; min-width: 64px; font-size: 13px; font-weight: 600; color: var(--grey-500); }
.brief-list li.b-decide b { color: var(--blue-500); }
.brief-list li.b-warn b { color: var(--warn); }
.brief-list li.b-danger b, .brief-list li.b-danger { color: var(--err); }
.brief-list li.b-ok b { color: var(--ok); }
.brief-list .b-go { margin-left: auto; font-size: 13px; font-weight: 600; }
.worker-state { margin: 6px 0 0; }
.worker-state span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--grey-600); }
.worker-state span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--grey-400); }
.worker-state span[data-state="online"] { color: var(--ok); }
.worker-state span[data-state="online"]::before { background: var(--ok); }
.worker-state span[data-state="busy"] { color: var(--blue-500); }
.worker-state span[data-state="busy"]::before { background: var(--blue-500); }
.worker-state span[data-state="offline"], .worker-state span[data-state="auth"] { color: var(--err); }
.worker-state span[data-state="offline"]::before, .worker-state span[data-state="auth"]::before { background: var(--err); }

/* 결재함 */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { height: 38px; padding: 0 16px; border: 0; border-radius: 99px; background: var(--surface); color: var(--grey-600); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow); transition: background .2s, color .2s; }
.tab:hover { color: var(--grey-900); }
.tab.active { background: var(--grey-900); color: #fff; }
.tab em { font-style: normal; margin-left: 4px; color: var(--blue-400); }
.tab em:empty { display: none; }
.approval-list { display: grid; gap: 12px; }
.a-item { display: grid; gap: 12px; }
.a-item.pending { box-shadow: inset 3px 0 0 var(--blue-500), var(--shadow); }
.a-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.a-title { font-size: 17px; font-weight: 700; color: var(--grey-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-title:hover { color: var(--blue-500); }
.a-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; font-size: 14px; }
.a-meta div { display: flex; gap: 8px; }
.a-meta dt { color: var(--grey-500); }
.a-meta dd { margin: 0; color: var(--grey-800); font-weight: 500; }
.a-reason { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--grey-050); font-size: 14px; color: var(--grey-700); }
.a-reason b { color: var(--grey-500); font-weight: 600; margin-right: 6px; }
.a-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.a-actions .btn { min-width: 76px; }

/* 재무현황 */
.finance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.card-head h3 small { font-size: 12px; }
.badge-stale { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 2px 8px; }
.cost-days { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 6px; }
.cost-days li { display: grid; grid-template-columns: 44px 1fr 64px; gap: 10px; align-items: center; font-size: 13px; }
.cd-date { color: var(--grey-500); font-variant-numeric: tabular-nums; }
.cd-bar { height: 8px; border-radius: 99px; background: var(--grey-100); overflow: hidden; }
.cd-bar i { display: block; height: 100%; width: 0; background: var(--blue-400); border-radius: 99px; }
.cd-val { text-align: right; color: var(--grey-700); font-variant-numeric: tabular-nums; }

/* 조직 및 업무현황 */
.org-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.org-tree { display: grid; justify-items: center; }
.ot-node { padding: 10px 18px; border-radius: 14px; font-weight: 700; font-size: 15px; }
.ot-top { background: var(--grey-900); color: #fff; }
.ot-mid { background: var(--blue-500); color: #fff; }
.ot-line { width: 2px; height: 18px; background: var(--grey-200); }
.ot-depts { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ot-depts li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--blue-050); text-align: center; }
.ot-depts li b { font-size: 14px; color: var(--grey-900); }
.ot-depts li span { font-size: 12px; color: var(--blue-600); }
.ot-depts li.empty { background: var(--grey-100); }
.ot-depts li.empty span { color: var(--grey-400); }
.emp { display: grid; gap: 14px; }
.emp + .emp { border-top: 1px solid var(--grey-100); padding-top: 16px; margin-top: 16px; }
.emp-head { display: flex; align-items: center; gap: 14px; }
.emp-head .avatar { width: 48px; height: 48px; font-size: 18px; }
.emp-id { display: grid; gap: 2px; flex: 1; min-width: 0; }
.emp-id strong { font-size: 17px; }
.emp-id strong small { font-size: 14px; font-weight: 500; color: var(--grey-500); margin-left: 4px; }
.emp-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.emp-meta div { display: grid; gap: 2px; min-width: 0; }
.emp-meta .wide { grid-column: 1 / -1; }
.emp-meta dt { font-size: 12px; color: var(--grey-500); font-weight: 600; }
.emp-meta dd { margin: 0; font-size: 14px; color: var(--grey-800); overflow-wrap: anywhere; }
.emp-meta .acct-row { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--grey-050); }
.acct-id { display: grid; gap: 2px; min-width: 180px; }
/* 계정 박스 오른쪽 상단 "연결방법" 버튼 */
.emp-meta .acct-row.has-conn { position: relative; padding-top: 40px; }
.acct-conn { position: absolute; top: 8px; right: 10px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; flex: none; }
.conn-dlg { display: grid; gap: 12px; }
.conn-dlg h3, .conn-dlg p { margin: 0; }
.conn-list { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.conn-label { display: block; font-size: 13px; font-weight: 600; color: var(--grey-700); margin-bottom: 4px; }
.conn-code { display: flex; align-items: flex-start; gap: 8px; background: var(--grey-050); border-radius: 10px; padding: 8px 8px 8px 12px; }
.conn-code code { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; color: var(--grey-900); white-space: pre-wrap; word-break: break-all; user-select: all; }
#connDlg .row-end .btn { flex: none; min-width: 88px; }
.emp-meta .acct-usage { margin-left: auto; display: grid; gap: 8px; min-width: 240px; flex: 0 1 320px; }
.emp-meta .mini-limit { display: grid; grid-template-columns: 60px 1fr 52px; align-items: center; gap: 10px; font-size: 13px; }
.mini-limit span { color: var(--grey-600); font-weight: 500; }
.mini-limit .mb { display: block; height: 8px; border-radius: 99px; background: var(--grey-200); overflow: hidden; }
.mini-limit .mb i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--blue-500); transition: width .6s var(--ease); }
.mini-limit b { text-align: right; font-weight: 700; color: var(--blue-500); font-variant-numeric: tabular-nums; }
.mini-limit.warn .mb i { background: #ffb331; } .mini-limit.warn b { color: var(--warn); }
.mini-limit.danger .mb i { background: var(--err); } .mini-limit.danger b { color: var(--err); }
.mini-limit.stale b { color: var(--grey-400); font-weight: 500; font-size: 12px; }
.emp .mini-reset { margin: -4px 0 0 70px; font-size: 12px; color: var(--grey-600); }
.mini-reset b { font-weight: 700; color: var(--grey-800); font-variant-numeric: tabular-nums; }
.acct-usage .badge-stale { justify-self: end; font-style: normal; }
.wk { font-style: normal; font-size: 11px; font-weight: 600; margin-left: 6px; padding: 1px 7px; border-radius: 6px; background: var(--grey-100); color: var(--grey-500); white-space: nowrap; }
.wk-online { background: var(--ok-bg); color: var(--ok); }
.wk-busy { background: var(--blue-050); color: var(--blue-500); }
.wk-offline, .wk-auth { background: var(--err-bg); color: var(--err); }
.acct-src { display: block; font-size: 11px; color: var(--grey-500); margin-top: 2px; }
.emp-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.emp-counts span { display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 10px; border-radius: 10px; background: var(--grey-050); font-size: 12px; color: var(--grey-600); }
.emp-counts b { font-size: 15px; color: var(--grey-900); font-variant-numeric: tabular-nums; }
.emp p { margin: 0; }
.doc-list li a { font-size: 15px; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.doc-titles { min-width: 0; }
.doc-titles p { margin: 4px 0 0; }
.doc-head select { width: auto; height: 34px; padding: 4px 10px; font-size: 13px; }
.doc-body { padding: 4px 2px 8px; font-size: 15px; max-height: 70vh; overflow-y: auto; }
.doc-editor { display: grid; gap: 12px; }
.doc-editor textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.6; resize: vertical; min-height: 320px; }
.doc-editor .row-end { align-items: center; }
.doc-editor .row-end .muted { margin-right: auto; }
.doc-view details.tech { margin-top: 14px; }
.doc-view .log { margin-top: 10px; }
.sub-head h2 { font-size: 20px; }
.dlg-wide { width: min(640px, calc(100vw - 32px)); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#empForm .row-end { align-items: center; }
#empForm .row-end .muted { margin-right: auto; }
#empForm .row-end .btn { flex: none; min-width: 88px; }

/* 기술 상세 접기 영역 */
.detail-main { display: grid; gap: 12px; min-width: 0; }
details.tech > summary { cursor: pointer; font-weight: 700; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.tech > summary::-webkit-details-marker, .tech-inline > summary::-webkit-details-marker { display: none; }
details.tech > summary::before, .tech-inline > summary::before { content: "›"; display: inline-block; transition: transform .2s; color: var(--grey-500); font-weight: 700; }
details[open].tech > summary::before, details[open].tech-inline > summary::before { transform: rotate(90deg); }
.tech-body { margin-top: 14px; display: grid; gap: 10px; }
.tech-body h4 { margin: 8px 0 0; font-size: 13px; color: var(--grey-500); }
.tech-pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 13px; background: var(--grey-050); border-radius: 10px; padding: 10px 12px; color: var(--grey-700); }
.tech-inline { margin-top: 8px; font-size: 13px; }
.tech-inline > summary { cursor: pointer; list-style: none; color: var(--grey-500); font-weight: 600; display: inline-flex; gap: 6px; }
.tech-inline[open] > .md { margin-top: 6px; }

/* office */
.office { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.chat { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 290px); min-height: 480px; overflow: hidden; }
.chat-head { padding: 20px 24px 14px; display: flex; justify-content: space-between; align-items: center; }
.timeline { flex: 1; overflow-y: auto; padding: 8px 24px 20px; display: flex; flex-direction: column; gap: 16px; background: var(--surface); }
.timeline .empty { margin: auto; font-size: 15px; text-align: center; }
.msg { max-width: 80%; display: grid; gap: 6px; animation: msg-in .28s var(--ease); }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg-meta { font-size: 12px; color: var(--grey-500); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 4px; }
.msg-bubble { padding: 13px 16px; border-radius: 18px; border-top-left-radius: 6px; background: var(--grey-100); color: var(--grey-900); word-break: break-word; }
.msg.user { align-self: flex-end; }
.msg.user .msg-meta { justify-content: flex-end; }
.msg.user .msg-bubble { background: var(--blue-500); color: #fff; border-radius: 18px; border-top-right-radius: 6px; white-space: pre-wrap; }
.msg.system { align-self: center; max-width: 92%; }
.msg.system .msg-bubble { background: transparent; color: var(--grey-500); font-size: 13px; padding: 4px 12px; border-radius: 99px; }
.msg.error .msg-bubble { background: var(--err-bg); color: var(--err); }
.msg.streaming .msg-bubble::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: var(--blue-500); vertical-align: middle; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
@keyframes blink { 50% { opacity: 0; } }
.msg-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--grey-100); color: var(--grey-600); white-space: nowrap; line-height: 1.5; }
.tag.s-queued { background: var(--grey-100); color: var(--grey-600); }
.tag.s-running { background: var(--blue-050); color: var(--blue-500); }
.tag.s-waiting_approval, .tag.s-pending { background: var(--warn-bg); color: var(--warn); }
.tag.s-completed, .tag.s-approved { background: var(--ok-bg); color: var(--ok); }
.tag.s-failed, .tag.s-rejected { background: var(--err-bg); color: var(--err); }
.tag.s-cancelled { color: var(--grey-400); }
.composer { padding: 12px 16px 16px; display: grid; gap: 10px; background: var(--surface); border-top: 1px solid var(--grey-100); }
.composer textarea { resize: none; min-height: 56px; max-height: 200px; border-radius: 16px; }
.composer-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 4px; }
.composer-row { display: flex; gap: 10px; align-items: stretch; }
.composer-row textarea { flex: 1; min-width: 0; }
.composer-row .btn { flex: none; min-width: 108px; height: auto; min-height: 56px; border-radius: 16px; align-self: stretch; }
.composer-bar { justify-content: flex-start; }
.composer-row .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--blue-100); background: var(--blue-600); }
.composer-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.attach-btn { display: inline-grid; place-items: center; color: var(--grey-600); }
.attach-btn:hover { color: var(--blue-500); background: var(--blue-050); }
.composer.drag { box-shadow: inset 0 0 0 2px var(--blue-400); background: var(--blue-050); }
.attach-list { display: flex; gap: 8px; flex-wrap: wrap; }
.attach-item { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--grey-100); display: grid; place-items: center; font-size: 11px; color: var(--grey-500); }
.attach-item img { width: 100%; height: 100%; object-fit: cover; }
.attach-item.loading span { animation: pulse 1s ease-in-out infinite; }
.attach-item.err { background: var(--err-bg); color: var(--err); }
.attach-x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0, 12, 30, .55); color: #fff; font-size: 14px; line-height: 20px; padding: 0; cursor: pointer; }
.attach-item.doc { width: auto; max-width: 200px; padding: 0 30px 0 12px; display: flex; align-items: center; gap: 6px; color: var(--grey-700); font-size: 13px; font-weight: 500; }
.attach-item.doc svg { flex: none; color: var(--blue-500); }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-docs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; white-space: normal; }
.doc-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; padding: 7px 12px; border-radius: 10px; background: rgba(255, 255, 255, .18); color: inherit; font-size: 13px; font-weight: 600; }
.doc-chip:hover { background: rgba(255, 255, 255, .28); color: inherit; }
.doc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.msg-images img { display: block; max-width: 180px; max-height: 180px; border-radius: 12px; object-fit: cover; background: rgba(255, 255, 255, .2); }

.side { display: grid; gap: 12px; }
.profile { display: flex; gap: 16px; align-items: center; }
.profile h3 { margin: 0 0 4px; font-size: 17px; }
.profile p { margin: 0; }
.avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--blue-050); color: var(--blue-500); font-weight: 700; font-size: 21px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.list li { display: grid; gap: 4px; font-size: 13px; padding: 12px 0; border-bottom: 1px solid var(--grey-100); }
.list li:first-child { padding-top: 0; }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list li a { font-weight: 600; font-size: 15px; color: var(--grey-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li a:hover { color: var(--blue-500); }
.list .row { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
#currentTask .row { display: flex; justify-content: space-between; gap: 6px; align-items: center; margin-bottom: 8px; }
#currentTask .pre { color: var(--grey-700); font-size: 14px; margin-bottom: 12px; }

/* usage chart */
.usage .card-head { margin-bottom: 4px; gap: 8px; }
.usage .card-head h3 { margin-bottom: 8px; }
.limit { display: grid; gap: 8px; padding: 10px 0 14px; }
.limit + .limit { border-top: 1px solid var(--grey-100); padding-top: 14px; }
.limit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.limit-head span { font-size: 15px; font-weight: 600; color: var(--grey-800); }
.limit-head span small { font-size: 12px; font-weight: 500; color: var(--grey-500); margin-left: 2px; }
.limit-head strong { font-size: 20px; font-weight: 700; letter-spacing: -.03em; color: var(--blue-500); font-variant-numeric: tabular-nums; }
.limit-bar { height: 10px; border-radius: 99px; background: var(--grey-100); overflow: hidden; }
.limit-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--blue-500); transition: width .6s var(--ease); }
.limit.warn .limit-head strong { color: var(--warn); }
.limit.warn .limit-bar i { background: #ffb331; }
.limit.danger .limit-head strong { color: var(--err); }
.limit.danger .limit-bar i { background: var(--err); }
.limit.stale .limit-head strong { color: var(--grey-400); }
.usage .limit-reset { margin: 0; }
#uNote strong { color: var(--grey-700); font-weight: 600; }
.usage-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.usage-sum span { display: block; font-size: 13px; color: var(--grey-600); font-weight: 500; }
.usage-sum strong { font-size: 22px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.usage-sum strong.muted { font-size: 16px; color: var(--grey-400); font-weight: 600; }
.usage-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.usage-chart .u-track { fill: var(--grey-100); }
.usage-chart .u-bar { fill: var(--blue-100); transition: fill .2s; }
.usage-chart .u-bar.today { fill: var(--blue-500); }
.usage-chart g:hover .u-bar { fill: var(--blue-400); }
.usage-chart .u-x, .usage-chart .u-max { fill: var(--grey-500); font-size: 9px; font-family: var(--font); }
.usage p { margin: 10px 0 0; line-height: 1.5; }

/* markdown */
.md { word-break: break-word; line-height: 1.7; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 16px 0 6px; font-size: 16px; }
.md h1 { font-size: 19px; }
.md p { margin: 6px 0; }
.md ul, .md ol { margin: 6px 0; padding-left: 20px; }
.md li { margin: 2px 0; }
.md code { background: rgba(0, 27, 55, .06); border-radius: 5px; padding: 1px 5px; font-size: 13px; }
.md pre { background: var(--grey-900); color: #e5e8eb; border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: 13px; }
.md pre code { background: none; padding: 0; color: inherit; }
.md table { border-collapse: collapse; margin: 10px 0; font-size: 13px; display: block; overflow-x: auto; }
.md th, .md td { border-bottom: 1px solid var(--grey-200); padding: 7px 10px; text-align: left; }
.md th { color: var(--grey-600); font-weight: 600; background: rgba(0, 27, 55, .03); }
.md blockquote { margin: 8px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--blue-100); color: var(--grey-700); }
.md hr { border: 0; border-top: 1px solid var(--grey-200); margin: 14px 0; }
.msg.user .md code { background: rgba(255, 255, 255, .2); }

/* tables / filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px; }
.filters input { flex: 1 1 220px; width: auto; }
.filters select { width: auto; flex: 0 0 auto; }
.table-wrap { padding: 8px 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; color: var(--grey-500); font-weight: 600; padding: 12px 20px; border-bottom: 1px solid var(--grey-100); white-space: nowrap; }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--grey-100); vertical-align: top; color: var(--grey-800); }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--grey-050); }
.table tr:last-child td { border-bottom: 0; }
.table td.clip { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table td a { font-weight: 600; }
.pager { display: flex; gap: 6px; justify-content: center; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.detail-grid aside { display: grid; gap: 12px; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; font-size: 13px; }
.log li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--grey-100); padding: 9px 0; color: var(--grey-700); }
.log li:last-child { border-bottom: 0; }
.log li time { color: var(--grey-500); white-space: nowrap; }

.dlg { border: 0; border-radius: 24px; padding: 28px 24px 20px; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.dlg[open] { animation: dlg-in .22s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.dlg::backdrop { background: rgba(0, 12, 30, .45); }
.dlg h3 { font-size: 20px; }
.dlg form { display: grid; gap: 14px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.dlg .row-end .btn { flex: 1; height: 50px; border-radius: 14px; }

/* responsive */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .office, .detail-grid, .finance-grid, .org-grid { grid-template-columns: minmax(0, 1fr); }
  .side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .topbar { padding: 0 12px; }
  .brand-sub, .who { display: none; }
  .sidebar { position: fixed; top: 60px; bottom: 0; left: 0; z-index: 40; transform: translateX(-100%); transition: transform .25s var(--ease); background: var(--surface); box-shadow: var(--shadow-lg); border-radius: 0 20px 20px 0; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 60px 0 0 0; background: rgba(0, 12, 30, .35); z-index: 35; }
  .sidebar a.active { background: var(--blue-050); box-shadow: none; }
  .main { padding: 16px; gap: 14px; }
  .card { padding: 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 16px 18px; }
  .stat strong { font-size: 24px; }
  .stat-worker { grid-column: span 2; }
  .stats.stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emp-meta, .form-grid { grid-template-columns: 1fr; }
  .emp-meta .acct-usage { margin-left: 0; min-width: 0; flex: 1 1 100%; }
  .brief-list .b-go { margin-left: 0; }
  .a-actions { justify-content: stretch; }
  .a-actions .btn { flex: 1; }
  .office { display: flex; flex-direction: column; }
  .chat { height: calc(100dvh - 80px); min-height: 0; order: -1; }
  .chat-head { padding: 16px 20px 10px; }
  .timeline { padding: 8px 16px 16px; }
  .composer { position: sticky; bottom: 0; }
  .msg { max-width: 92%; }
  .composer-row .btn { min-width: 76px; padding: 0 12px; }
  .page-head h1 { font-size: 22px; }
}

/* 지시 받는 직원 선택 (사장실 업무지시) */
.recipients { display: flex; gap: 6px; flex-wrap: wrap; }
.recipient { display: inline-flex; align-items: baseline; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.recipient small { font-size: 12px; font-weight: 500; color: var(--muted); }
.recipient:hover { background: var(--surface-2); }
.recipient.active { background: var(--navy-050); border-color: var(--blue-100); color: var(--navy-600); }
.recipient.active small { color: var(--navy-600); }
.recipient .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grey-400); align-self: center; }
.recipient .dot.on { background: var(--ok); }
.recipient .dot.busy { background: var(--blue-500); }
.recipient .dot.bad { background: var(--err); }
