/* VicMind 공통 플랫폼 화면. 색은 Board 셸 토큰 사본과 platform-tokens.css에서 읽는다.
   왼쪽 메뉴(.function-nav)는 vicmind.co.kr B-Mind 예시(b-mind-example console.css·collaboration.css)
   값을 그대로 쓴다(총지휘관 2026-11-02). 예시 메뉴 색(--nav-*)은 로고색과 다르면 예시를 따른다(docs/chat-and-calendar.md 1절).
   글꼴은 자체 제공 Pretendard(public/fonts/VENDOR.md). */
@font-face {
  font-family: 'Pretendard Variable';
  src: url('/static/fonts/PretendardVariable.woff2') format('woff2');
  font-weight: 45 920;
  font-display: swap;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Pretendard Variable', system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: hsl(var(--vm-foreground));
  background: hsl(var(--vm-background));
  line-height: 1.5;
}

.vm-shell { min-height: 100vh; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Board 셸: 위 막대·업무 공간 메뉴·빈 검색 자리. */
.shell-drawer-toggle { display: none; }
.shell-topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--vm-topbar-gap); height: var(--vm-topbar-height); padding: var(--vm-topbar-pad); background: hsl(var(--vm-topbar-background)); color: hsl(var(--vm-foreground)); border-bottom: 1px solid hsl(var(--vm-border)); }
.shell-topbar :focus-visible, .function-nav a:focus-visible { outline: 2px solid hsl(var(--vm-ring)); outline-offset: 2px; }
.shell-topbar a { text-decoration: none; }
.shell-burger { display: none; align-items: center; justify-content: center; flex: none; width: 2rem; height: 2rem; border-radius: var(--vm-radius); color: hsl(var(--vm-foreground)); cursor: pointer; transition: background-color .15s; }
.shell-burger:hover { background: hsl(var(--vm-accent)); }
.shell-burger svg { width: 1rem; height: 1rem; }
.shell-workspace { position: relative; flex: none; width: var(--vm-workspace-width); min-width: 0; padding-right: .5rem; }
.shell-ws-menu { position: relative; min-width: 0; }
.shell-ws-toggle { display: flex; align-items: center; gap: .625rem; width: 100%; min-width: 0; padding: .25rem .375rem; border-radius: var(--vm-radius); color: hsl(var(--vm-foreground)); list-style: none; cursor: pointer; transition: background-color .15s; }
.shell-ws-toggle::-webkit-details-marker { display: none; }
.shell-ws-toggle:hover { background: hsl(var(--vm-muted)); }
.shell-ws-static { cursor: default; }
.shell-ws-static:hover { background: transparent; }
.shell-badge { display: flex; align-items: center; justify-content: center; flex: none; width: var(--vm-badge-size); height: var(--vm-badge-size); border-radius: var(--vm-badge-radius); background: hsl(var(--vm-workspace-badge)); border: 1px solid hsl(var(--vm-border)); overflow: hidden; font-size: var(--vm-badge-font-size); font-weight: 700; line-height: 1; }
.shell-badge img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo { object-fit: contain; }
.menu-guide { margin: 0 0 16px; padding: 16px 24px; border: 1px solid hsl(var(--vm-border)); border-radius: var(--vm-dialog-radius); background: hsl(var(--vm-card)); box-shadow: 0 12px 32px rgb(0 0 0 / .18); font-size: 14px; }
.menu-guide p { margin: 0 0 8px; }
.menu-guide dl { display: grid; grid-template-columns: 3em 1fr; gap: 4px 12px; margin: 8px 0; }
.menu-guide dd { margin: 0; }
.menu-guide a { margin-right: 16px; text-underline-offset: 3px; }
.vm-company { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--vm-company-size); font-weight: 600; line-height: 1.5; letter-spacing: -.025em; }
.shell-ws-caret { flex: none; width: 1rem; height: 1rem; color: hsl(var(--vm-muted-foreground)); }
.shell-ws-pop { position: absolute; left: 0; top: 100%; z-index: 50; margin-top: .25rem; width: 14rem; display: flex; flex-direction: column; gap: .125rem; padding: .25rem; font-size: .875rem; line-height: 1.25rem; background: hsl(var(--vm-card)); color: hsl(var(--vm-card-foreground)); border: 1px solid hsl(var(--vm-border)); border-radius: var(--vm-radius); box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); }
.shell-ws-pop form { margin: 0; }
.shell-ws-item { display: block; width: 100%; padding: .375rem .75rem; border: 0; border-radius: calc(var(--vm-radius) - 2px); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.shell-ws-item:hover { background: hsl(var(--vm-muted)); }
.shell-search-wrap { flex: 1; min-width: 0; display: flex; justify-content: center; }
.shell-scrim { display: none; }

.app-layout { position: relative; display: flex; min-height: calc(100vh - var(--vm-topbar-height)); }

/* 왼쪽 메뉴: 예시 nav.function-nav. */
.function-nav {
  width: 104px;
  flex-shrink: 0;
  border-right: 1px solid var(--nav-line);
  background: var(--nav-rail);
  display: flex;
  flex-direction: column;
  padding: 14px 10px 16px;
  gap: 28px;
}
.nav-items { display: flex; flex-direction: column; gap: var(--vm-nav-items-gap); }
.nav-button {
  border: 0;
  background: transparent;
  border-radius: var(--vm-nav-radius);
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: var(--vm-nav-gap);
  font-size: var(--vm-nav-font);
  line-height: var(--vm-nav-line);
  width: 100%;
  padding: var(--vm-nav-pad);
  color: var(--nav-text);
  white-space: normal;
  text-align: center;
  text-decoration: none;
}
.nav-button svg { width: var(--vm-nav-icon); height: var(--vm-nav-icon); stroke-width: 1.65; }
a.nav-button:hover { background: var(--nav-hover); }
.nav-button[aria-current="page"] { background: var(--nav-current-bg); color: var(--nav-current-text); font-weight: 700; }
.nav-button[data-menu-state="preparing"] { color: var(--nav-muted); }
.am-menu-label { font-size: 10px; line-height: 1.5; color: var(--nav-label); margin: 16px 0 5px; text-align: center; letter-spacing: .02em; }
.nav-user {
  margin-top: auto;
  display: grid;
  justify-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--nav-muted);
  text-decoration: none;
  text-align: center;
}
.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--nav-current-bg);
  color: var(--nav-current-text);
  font-size: 14px;
  font-weight: 700;
}
.vm-subtabs { list-style: none; margin: 0; padding-left: 12px; font-size: 11px; }

.vm-badge { font-size: 10px; color: var(--nav-muted); }

.vm-main { flex: 1; min-width: 0; padding: 20px 24px; }
.vm-notice { color: hsl(var(--vm-muted-foreground)); }
.vm-error { color: hsl(var(--vm-destructive)); }

.vm-login { max-width: 26rem; margin: 3rem auto; padding: 2.5rem 2.25rem; background: hsl(var(--vm-card)); border: 1px solid hsl(var(--vm-border)); border-radius: calc(var(--vm-radius) + 6px); box-shadow: 0 8px 24px rgb(0 0 0 / .08); }
.vm-login > section { margin-top: 24px; }
.vm-login > h1 { margin: 0 0 24px; font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.vm-login > section > h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.vm-login-password label { display: block; margin: 8px 0; }
.vm-login-password input { width: 100%; padding: var(--vm-input-pad); min-height: var(--vm-input-min); border: var(--vm-input-border) solid hsl(var(--vm-input)); border-radius: var(--vm-input-radius); font: inherit; font-size: var(--vm-input-font); line-height: var(--vm-input-line); }

.vm-login-password button, .vm-login-oidc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--vm-button-pad);
  min-height: var(--vm-button-min-height);
  border: 0;
  border-radius: var(--vm-button-radius);
  background: hsl(var(--vm-primary-soft));
  color: hsl(var(--vm-primary));
  font: inherit;
  font-size: var(--vm-button-font);
  font-weight: 600;
  line-height: var(--vm-button-line);
  text-decoration: none;
  cursor: pointer;
}
.vm-login-password button:hover, .vm-login-oidc:hover { background: hsl(var(--vm-primary-soft-hover)); }
.vm-login-password :focus-visible, .vm-login-oidc:focus-visible { outline: 2px solid hsl(var(--vm-ring)); outline-offset: 2px; }
.vm-login-oidc { margin: 6px 0; }

/* Board 페이지 패턴. 서버 HTML과 React 공용 요소가 같은 클래스를 쓴다. */
.vm-main.vm-page { padding: 20px 24px; font-size: 13px; line-height: 1.5; }
.vm-main.vm-page.vm-edge { padding: 0; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.app-layout:has(.vm-edge) { height: calc(100dvh - var(--vm-topbar-height)); min-height: 0; }
.vm-edge > [data-screen-state] { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.vm-edge #vm-app { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.vm-page :focus-visible, .app-dialog :focus-visible { outline: 2px solid hsl(var(--vm-ring)); outline-offset: 2px; }
.vm-page .page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 24px; }
.vm-page .page-head-text { min-width: 0; }
.vm-page .page-eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: hsl(var(--vm-muted-foreground)); }
.vm-page .page-head :is(h1, h2, h3, h4, h5, h6) { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.vm-page .page-head :is(h1, h2, h3, h4, h5, h6)::after { content: "."; color: hsl(var(--vm-primary)); }
.vm-page .page-sub { margin: 8px 0 0; font-size: 13px; color: hsl(var(--vm-muted-foreground)); }
.vm-page .page-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.vm-page .stat-row { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 0 0 24px; }
.vm-page .stat-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; background: hsl(var(--vm-card)); border: 1px solid hsl(var(--vm-border)); border-radius: 8px; }
.vm-page .stat-text { display: flex; flex-direction: column; min-width: 0; }
.vm-page .stat-label { font-size: 12px; font-weight: 600; color: hsl(var(--vm-muted-foreground)); }
.vm-page .stat-value { display: flex; align-items: baseline; gap: 4px; margin-top: 8px; line-height: 1; }
.vm-page .stat-value b { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: hsl(var(--vm-foreground)); }
.vm-page .stat-unit { font-size: 12px; font-weight: 600; color: hsl(var(--vm-muted-foreground)); }
.vm-page .stat-help { margin-top: 8px; font-size: 11px; color: hsl(var(--vm-muted-foreground)); }
.vm-page a.stat-card { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.vm-page a.stat-card:hover { border-color: hsl(var(--vm-input)); box-shadow: 0 2px 6px rgb(0 0 0 / .06); }
.vm-page .card { padding: 20px; border-radius: 12px; border: 1px solid hsl(var(--vm-border)); background: hsl(var(--vm-card)); box-shadow: 0 2px 4px rgb(0 0 0 / .02); }
.vm-page .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 16px; }
.vm-page .card-head-text { min-width: 0; }
.vm-page .card-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; color: hsl(var(--vm-foreground)); }
.vm-page .card-sub { margin: 4px 0 0; font-size: 12px; color: hsl(var(--vm-muted-foreground)); }
.vm-page .count-pill { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 24px; height: 22px; padding: 0 8px; border-radius: 6px; background: hsl(var(--vm-muted)); color: hsl(var(--vm-muted-foreground)); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vm-page .row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px; border-top: 1px solid hsl(var(--vm-border)); border-radius: 8px; }
.vm-page .row:first-child { border-top: 0; }
.vm-page .app-accounts tr.row { display: table-row; height: 64px; }
.vm-page .app-accounts td .row { padding: 0; border: 0; min-height: 0; }
.vm-page .row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.vm-page .row .t { font-size: 15px; font-weight: 600; line-height: 1.4; letter-spacing: -.01em; overflow-wrap: anywhere; color: hsl(var(--vm-foreground)); }
.vm-page .row-sub { font-size: 13px; line-height: 1.4; color: hsl(var(--vm-muted-foreground)); overflow-wrap: anywhere; }
.vm-page .row .meta { flex: none; font-size: 13px; font-variant-numeric: tabular-nums; color: hsl(var(--vm-muted-foreground)); white-space: nowrap; }
.vm-page a.row { color: hsl(var(--vm-foreground)); text-decoration: none; transition: background-color .15s; }
.vm-page button.row { width: 100%; border-right: 0; border-bottom: 0; border-left: 0; background: transparent; color: hsl(var(--vm-foreground)); font: inherit; text-align: left; cursor: pointer; transition: background-color .15s; }
.vm-page a.row:hover, .vm-page button.row:hover { background: hsl(var(--vm-muted)); }
.vm-page .row .chev { flex: none; width: 16px; height: 16px; margin: 0 2px 0 0; color: hsl(var(--vm-muted-foreground)); opacity: .5; transition: transform .15s, opacity .15s; }
.vm-page .row .chev path { stroke-width: 2.25; }
.vm-page a.row:hover .chev { opacity: .9; transform: translateX(2px); }
.vm-page .badge { display: inline-flex; align-items: center; flex: none; height: 22px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 600; letter-spacing: 0; white-space: nowrap; background: var(--vm-status-default); color: var(--vm-status-default-foreground); }
.vm-page .badge.done { background: var(--vm-status-done); color: var(--vm-status-done-foreground); }
.vm-page .badge.open { background: var(--vm-status-open); color: var(--vm-status-open-foreground); }
.vm-page .badge.active { background: var(--vm-status-active); color: var(--vm-status-active-foreground); }
.vm-page .badge.hold { background: var(--vm-status-hold); color: var(--vm-status-hold-foreground); }
.vm-page .badge.muted { background: var(--vm-status-muted); color: var(--vm-status-muted-foreground); }
.vm-page .empty { padding: 32px 20px; font-size: 13px; color: hsl(var(--vm-muted-foreground)); text-align: center; }

/* 예시 메뉴 폭은 유지하고, Board 768px 아래 서랍 안에도 같은 세로 메뉴를 둔다. */
@media (max-width: 1000px) {
  .function-nav { width: 86px; padding-left: 6px; padding-right: 6px; }
}
@media (max-width: 767px) {
  .shell-drawer-toggle { display: block; }
  .shell-burger { display: inline-flex; }
  .shell-drawer-toggle:checked ~ .vm-shell .shell-burger { background: hsl(var(--vm-accent)); }
  .shell-drawer-toggle:focus-visible ~ .vm-shell .shell-burger { outline: 2px solid hsl(var(--vm-ring)); outline-offset: 2px; }
  /* 예시 console-mobile-nav: 위 막대에 회사 이름 14px 한 줄·로고, 메뉴 단추 44px·아이콘 24px. */
  .shell-burger { width: 44px; height: 44px; border-radius: 6px; }
  .shell-burger svg { width: 24px; height: 24px; }
  .shell-workspace { flex: 1 1 0%; width: auto; min-width: 0; padding-right: 0; }
  .shell-ws-toggle { gap: 8px; }
  .shell-search-wrap { flex: 0 0 auto; }
  .shell-ws-caret { display: none; }
  /* 예시 서랍(#console-menu-drawer): 폭 min(300px, 100vw - 56px), 행형 메뉴, 세로 스크롤. 위 막대 아래에 겹쳐 본문 폭을 밀지 않는다. */
  .function-nav { display: none; position: fixed; top: var(--vm-topbar-height); bottom: 0; left: 0; z-index: 45; width: min(300px, calc(100vw - 56px)); padding: 16px 12px 24px; gap: 20px; overflow-y: auto; overscroll-behavior: contain; box-shadow: 8px 0 28px var(--vm-drawer-shadow); }
  .function-nav .nav-items { gap: 4px; }
  .function-nav .nav-button { flex-direction: row; justify-content: flex-start; flex-shrink: 0; gap: 12px; min-height: 48px; padding: 12px 14px; border-radius: 6px; font-size: 14px; line-height: 1.5; text-align: left; }
  .function-nav .nav-button svg { flex-shrink: 0; width: 22px; height: 22px; }
  .function-nav .am-menu-label { margin: 16px 0 5px; padding: 0 14px; text-align: left; }
  .function-nav .nav-user { display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 16px 14px 0; border-top: 1px solid var(--nav-line); font-size: 12px; text-align: left; }
  .shell-drawer-toggle:checked ~ .vm-shell .function-nav { display: flex; }
  .shell-drawer-toggle:checked ~ .vm-shell .shell-scrim { display: block; position: fixed; top: var(--vm-topbar-height); right: 0; bottom: 0; left: 0; z-index: 44; }
  .vm-main { padding: 1.5rem 1.25rem; }
  .vm-main.vm-page { padding: 1.5rem 1.25rem; font-size: 14px; }
  .vm-main.vm-page.vm-edge { padding: 0; }
  .menu-guide { border-radius: var(--vm-dialog-radius); }
  .vm-page .page-head { flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 20px; }
  .vm-page .page-actions { width: 100%; }
  .vm-page .stat-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 20px; }
  .vm-page .stat-card { padding: 14px 16px; }
  .vm-page .card { padding: 20px 16px; }
  .vm-login { width: calc(100% - 2.5rem); margin: 1.5rem auto; padding: 1.75rem 1.5rem 2rem; }
}
.button-hit { display: none; }
@media (pointer: coarse) {
  .shell-burger, .shell-ws-toggle, .shell-ws-item, .nav-button, .nav-user, .vm-login-password button, .vm-login-password input, .vm-login-oidc { min-height: 44px; min-width: 44px; }
  .vm-page button:not(.button-sm):not(.composer-tool), .vm-page input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]), .vm-page select, .vm-page textarea, .vm-page a.row, .vm-page a.stat-card, .app-dialog button:not(.button-sm):not(.composer-tool), .app-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]), .app-dialog select, .app-dialog textarea { min-height: 44px; min-width: 44px; }
  .button-sm, .composer-tool { position: relative; overflow: visible; appearance: none; }
  .button-sm { min-height: var(--vm-button-sm-height); height: var(--vm-button-sm-height); min-width: 0; padding: var(--vm-button-sm-pad); border-radius: var(--vm-button-sm-radius); }
  .composer-tool { width: var(--vm-tool-size-w); height: var(--vm-tool-size-h); min-width: var(--vm-tool-size-w); min-height: var(--vm-tool-size-h); padding: 0; border-radius: var(--vm-tool-radius); }
  .button-hit { display: block; position: absolute; z-index: 1; left: 50%; top: 50%; width: max(100%, var(--vm-coarse-min)); height: max(100%, var(--vm-coarse-min)); transform: translate(-50%, -50%); background: transparent; }
  .vm-page label:has(> input[type="checkbox"]), .vm-page label:has(> input[type="radio"]), .app-dialog label:has(> input[type="checkbox"]), .app-dialog label:has(> input[type="radio"]) { min-height: var(--vm-coarse-min); min-width: var(--vm-coarse-min); }
  .vm-page input[type="checkbox"], .vm-page input[type="radio"], .app-dialog input[type="checkbox"], .app-dialog input[type="radio"] { width: auto; min-width: 0; height: auto; min-height: 0; padding: 0; }
  .nav-button { border-radius: var(--vm-nav-radius); }
  .button-default { min-height: var(--vm-button-min-height); border-radius: var(--vm-button-radius); }
  .app-input-wrap, .vm-login-password input, .app-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), .app-form select, .app-form textarea { border-radius: var(--vm-input-radius); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
