
/* Layout: sticky top bar + tab nav; one content column (max 1180px); cards and tables; a detail drawer from the right (full width under 760px). */
:root {
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-2: #eaede8;
  --ink: #17211f;
  --ink-2: #4f5a57;
  --muted: #7d8683;
  --line: #d9ded9;
  --accent: #334434;
  --accent-ink: #ffffff;
  --accent-soft: #e3eae2;
  --gold: #a2967a;
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --chart-grid: #e1e0d9;
  --chart-axis: #c3c2b7;
  --shadow: 0 10px 30px rgba(23, 33, 31, 0.14);
  --font: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141716; --surface: #1d2120; --surface-2: #262b29; --ink: #eef1ee; --ink-2: #c3c9c5;
    --muted: #8e9792; --line: #333a37; --accent: #9dbb9a; --accent-ink: #0f1a10; --accent-soft: #233126; --gold: #c2b48f;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --chart-grid: #2c2c2a; --chart-axis: #383835;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141716; --surface: #1d2120; --surface-2: #262b29; --ink: #eef1ee; --ink-2: #c3c9c5;
  --muted: #8e9792; --line: #333a37; --accent: #9dbb9a; --accent-ink: #0f1a10; --accent-soft: #233126; --gold: #c2b48f;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --chart-grid: #2c2c2a; --chart-axis: #383835;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark { width: 44px; height: 30px; display: grid; place-items: center; }
.brand-mark img { width: 44px; height: auto; display: block; }
img.logo-light { display: block; } img.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) img.logo-light { display: none; } :root:not([data-theme="light"]) img.logo-dark { display: block; } }
:root[data-theme="dark"] img.logo-light { display: none; } :root[data-theme="dark"] img.logo-dark { display: block; }
.wordmark { height: 46px; width: auto; }
.wordmark-hero { width: min(360px, 70vw); height: auto; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.datechip { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; }
.userpick { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.userpick select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 8px; }
.nav { max-width: 1180px; margin: 0 auto; display: flex; gap: 2px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: 0 0 auto; padding: 10px 14px; text-decoration: none; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.nav a .cnt { font-size: 11px; color: var(--muted); margin-left: 4px; }

/* content */
main { max-width: 1180px; margin: 0 auto; padding-block: 18px 80px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.notice { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; font-size: 13px; color: var(--ink-2); }
.notice b { color: var(--ink); }
.view[hidden] { display: none; }
h2 { font-size: 20px; margin: 0 0 4px; letter-spacing: -0.01em; text-wrap: balance; }
h3 { font-size: 15px; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
h3 .cnt { font-size: 12px; font-weight: 500; color: var(--muted); }
.lead { color: var(--ink-2); margin: 0 0 14px; max-width: 70ch; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 12px; color: var(--ink-2); }
.chip b { color: var(--ink); font-weight: 600; margin-right: 2px; }
.chip.crit b { color: var(--crit); }
.chip.warn b { color: #9a6700; }
.empty { color: var(--muted); font-size: 13px; padding: 14px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 12px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; text-align: left; width: 100%; }
.card:hover { border-color: var(--accent); }
.card::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; background: var(--unit); }
.card .ttl { font-weight: 600; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.card .sub { color: var(--ink-2); font-size: 12.5px; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--muted); }
.card .note { color: var(--ink-2); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 6px; padding: 1px 7px; font-size: 11.5px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.unit { color: var(--unit); background: color-mix(in srgb, var(--unit) 12%, transparent); font-weight: 600; }
.pill.ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: #0a6a0a; }
.pill.late { background: color-mix(in srgb, var(--crit) 14%, transparent); color: var(--crit); }
.pill.soon { background: color-mix(in srgb, var(--warn) 22%, transparent); color: #7a5200; }
.pill.stale { background: color-mix(in srgb, var(--serious) 18%, transparent); color: #a0431e; }
.pill.none { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.pill.imp { background: color-mix(in srgb, var(--s1) 14%, transparent); color: var(--s1); }
:root[data-theme="dark"] .pill.ok, :root[data-theme="dark"] .pill.soon, :root[data-theme="dark"] .pill.stale { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.ok, :root:not([data-theme="light"]) .pill.soon, :root:not([data-theme="light"]) .pill.stale { color: var(--ink); } }
.ppl { display: inline-flex; gap: 3px; }
.av { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.av.me { background: var(--accent); color: var(--accent-ink); }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.col { background: var(--surface-2); border-radius: 12px; padding: 10px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.col h4 { margin: 2px 4px 4px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.col h4 .cnt { font-size: 12px; font-weight: 600; background: var(--surface); border-radius: 999px; padding: 0 8px; }
.col.late h4 { color: var(--crit); }
.col .mini { background: var(--surface); border-radius: 8px; padding: 8px 10px; border: 1px solid transparent; display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%; min-width: 0; }
.col .mini:hover { border-color: var(--accent); }
.col .mini .ttl { font-size: 12.5px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.col .mini .meta { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--muted); align-items: center; }
.col .more { font-size: 12px; color: var(--accent); background: none; border: 0; text-align: left; padding: 4px; }
.col .hint { font-size: 12px; color: var(--muted); padding: 6px 4px; }
@media (max-width: 900px) { .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kanban { grid-template-columns: 1fr; } }

/* tiles & charts */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin-top: 2px; }
.tile .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.tile .d { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
@media (max-width: 820px) { .panels { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.panel h4 { margin: 0 0 2px; font-size: 14px; }
.panel .src { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin: 4px 0 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
svg.chart { width: 100%; max-width: 540px; height: auto; display: block; overflow: visible; }
svg.chart text { font-family: var(--font); fill: var(--ink-2); font-size: 12px; }
svg.chart .val { fill: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
svg.chart .lbl { fill: var(--ink); }
svg.chart .grid { stroke: var(--chart-grid); }
svg.chart .axis { stroke: var(--chart-axis); }
svg.chart .bar { rx: 3; }
svg.chart .hit { fill: transparent; }
svg.chart .hit:hover + .bar, svg.chart g:hover .bar { filter: brightness(0.92); }
.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12px; padding: 6px 9px; border-radius: 6px; box-shadow: var(--shadow); max-width: 260px; }
.tip[hidden] { display: none; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; }
table.grid td.r, table.grid th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid td.nw { white-space: nowrap; }
table.grid tbody tr.row { cursor: pointer; }
table.grid tbody tr.row:hover td { background: var(--surface-2); }
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.tablewrap table { min-width: 860px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.filters select, .filters input { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.filters input { flex: 1 1 180px; }
.filters .cnt { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--unit); margin-right: 6px; vertical-align: 1px; }
.trunc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 30; }
.scrim[hidden] { display: none; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); z-index: 31; box-shadow: var(--shadow); overflow-y: auto; padding-block: calc(16px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)); padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 14px; }
.drawer[hidden] { display: none; }
.drawer .hd { display: flex; align-items: flex-start; gap: 10px; }
.drawer .hd h2 { font-size: 17px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.drawer .x { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 34px; height: 34px; flex: 0 0 auto; font-size: 18px; line-height: 1; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 13px; }
.kv div { min-width: 0; }
.kv .k { font-size: 11.5px; color: var(--muted); }
.kv .v { overflow-wrap: anywhere; }
.sec { border-top: 1px solid var(--line); padding-top: 12px; }
.sec h4 { margin: 0 0 8px; font-size: 13px; display: flex; justify-content: space-between; align-items: baseline; }
.sec h4 small { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tl li { display: grid; grid-template-columns: 58px 1fr; gap: 8px; font-size: 13px; align-items: baseline; }
.tl .d { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl .t { overflow-wrap: anywhere; color: var(--ink-2); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.form label.full { grid-column: 1 / -1; }
.form input, .form select { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 8px 10px; min-width: 0; width: 100%; }
.form .check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; padding-top: 18px; }
.form .check input { width: auto; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 12px; font-weight: 500; font-size: 13px; }
.btn.pri { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.preview { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.preview .ph { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
.steps { display: flex; gap: 4px; margin: 8px 0; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--accent); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 40; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; }
.toast[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) { .drawer { animation: slide .18s ease-out; } @keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } } }
@media (max-width: 760px) { .kv { grid-template-columns: 1fr; } .form { grid-template-columns: 1fr; } .form .check { padding-top: 0; } }

/* 공개 홈페이지(외부망) */
.pubbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.pubbar[hidden] { display: none; }
.pubbar-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); flex-wrap: wrap; }
.pubbar .links { display: flex; gap: 16px; font-size: 13.5px; color: var(--ink-2); flex-wrap: wrap; }
.pubbar .links a { color: inherit; text-decoration: none; }
.pubbar .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; padding-block: 28px 10px; }
.hero h1 { font-size: 30px; line-height: 1.25; margin: 0 0 10px; letter-spacing: -0.02em; text-wrap: balance; }
.hero p { color: var(--ink-2); margin: 0 0 16px; max-width: 46ch; }
.hero .art { aspect-ratio: 4 / 3; max-width: 100%; border-radius: 14px; background: linear-gradient(160deg, var(--accent-soft), var(--surface-2)); border: 1px solid var(--line); position: relative; overflow: hidden; }
.hero .art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.biz { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.biz .b { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-width: 0; }
.biz .b .n { font-weight: 600; margin-bottom: 4px; }
.biz .b .d { font-size: 12.5px; color: var(--ink-2); }
.biz .b .c { font-size: 12px; color: var(--muted); margin-top: 8px; }
.pubfoot { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 14px; font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.flowhint { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); margin: 14px 0; }
.flowhint b { color: var(--ink); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .biz { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero h1 { font-size: 24px; } }
@media (max-width: 480px) { .biz { grid-template-columns: 1fr; } }

/* 로그인 모달 */
.modal { position: fixed; inset: 0; z-index: 32; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal .box { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); width: min(420px, 100%); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal h3 { margin: 0; font-size: 17px; }
.modal .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal .big { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 16px 12px; text-align: center; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.modal .big b { font-size: 15px; }
.modal .big span { font-size: 12px; color: var(--muted); }
.modal .big.on { border-color: var(--accent); background: var(--accent-soft); }
.modal .fine { font-size: 12px; color: var(--muted); }

/* 내부망 홈 */
.hello { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.hello h2 { margin: 0; }
.punch { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.punch .st { font-size: 12.5px; color: var(--ink-2); }
.menu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.menu a { position: relative; display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-decoration: none; color: inherit; min-height: 96px; min-width: 0; }
.menu a:hover { border-color: var(--accent); }
.menu a .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.menu a .n { font-weight: 600; }
.menu a .d { font-size: 12px; color: var(--muted); }
.menu a .bd { position: absolute; top: 12px; right: 12px; background: var(--crit); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 600; padding: 1px 7px; }
.menu a .bd.n { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 900px) { .menu { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.inbox { display: flex; flex-direction: column; gap: 8px; }
.inbox .it { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; flex-wrap: wrap; }
.inbox .it .who { color: var(--muted); font-size: 12px; }
.inbox .it .acts { margin-left: auto; display: flex; gap: 6px; }

/* 견적서 만들기 */
.quote { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .quote { grid-template-columns: 1fr; } }
.qform { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.qform textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 8px 10px; min-height: 96px; width: 100%; resize: vertical; font: inherit; color: inherit; }
.qform table { width: 100%; border-collapse: collapse; font-size: 13px; }
.qform td, .qform th { padding: 4px 4px; border-bottom: 1px solid var(--line); }
.qform th { font-size: 11.5px; color: var(--muted); font-weight: 500; text-align: left; }
.qform td input { width: 100%; border: 1px solid var(--line); background: var(--bg); padding: 6px 8px; border-radius: 6px; min-width: 0; font: inherit; color: inherit; }
.qform td input:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.qform td input::placeholder { color: var(--muted); }
.qform td.n input { text-align: right; font-variant-numeric: tabular-nums; }
.ai { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); }
.ai b { color: var(--ink); }
.sheet { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 6px; padding: 22px 24px; font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', var(--font); font-size: 12px; box-shadow: var(--shadow); overflow-x: auto; }
.sheet * { box-sizing: border-box; }
.sheet .t { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: 0.4em; margin: 0 0 8px; }
.sheet table { border-collapse: collapse; width: 100%; font-size: 11.5px; }
.sheet td, .sheet th { border: 1px solid #333; padding: 5px 6px; vertical-align: middle; }
.sheet th { background: #f0f0f0; font-weight: 600; text-align: center; }
.sheet .nob td { border: 0; padding: 3px 0; }
.sheet .sup { width: 100%; }
.sheet .sup th { width: 22%; }
.sheet .money td { font-weight: 700; text-align: center; }
.sheet .items td.r { text-align: right; font-variant-numeric: tabular-nums; }
.sheet .items td.c { text-align: center; }
.sheet .notes { margin-top: 10px; font-size: 11.5px; font-weight: 600; line-height: 1.7; }
.sheet .stamp { display: inline-block; border: 2px solid #c8344a; color: #c8344a; border-radius: 50%; width: 38px; height: 38px; line-height: 34px; text-align: center; font-size: 10px; font-weight: 700; transform: rotate(-12deg); margin-left: 6px; vertical-align: middle; }

/* 고객 조회 페이지 */
.client { max-width: 640px; margin: 0 auto; }
.client .cardc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.client .stage { display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 6px; }
.client .stage div { text-align: center; font-size: 12px; color: var(--muted); }
.client .stage div i { display: block; height: 8px; border-radius: 4px; background: var(--line); margin-bottom: 6px; }
.client .stage div.on { color: var(--ink); font-weight: 600; }
.client .stage div.on i { background: var(--accent); }
.client .pub { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.client .pub li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; font-size: 13.5px; }
.client .pub li .d { color: var(--muted); font-variant-numeric: tabular-nums; }

/* 홈페이지 본문 섹션 */
.sec-pub { padding-block: 26px 6px; }
.sec-pub h2 { font-size: 20px; margin: 0 0 12px; }
.sec-pub .eyebrow { font-size: 11.5px; letter-spacing: 0.08em; color: var(--gold); font-weight: 600; margin-bottom: 4px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.facts .f { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.facts .f .k { font-size: 12px; color: var(--muted); }
.facts .f .v { font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hist li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hist li .d { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.orgchart { display: grid; gap: 10px; }
.orgchart .top { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.orgchart .node { background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 8px 18px; font-weight: 600; text-align: center; }
.orgchart .node.sub { background: var(--surface-2); color: var(--ink); }
.orgchart .depts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.orgchart .dept { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 0; }
.orgchart .dept h4 { margin: 0 0 6px; text-align: center; font-size: 14px; }
.orgchart .dept div { font-size: 12.5px; color: var(--ink-2); text-align: center; padding: 3px 0; border-top: 1px dashed var(--line); }
@media (max-width: 1000px) { .orgchart .depts { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 760px) { .orgchart .depts { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } .hist li { grid-template-columns: 90px 1fr; } }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stats .s { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; min-width: 0; }
.stats .s b { display: block; font-size: 26px; letter-spacing: -0.02em; }
.stats .s span { font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 조직도(내부망) */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.person .av { width: 40px; height: 40px; font-size: 14px; flex: 0 0 auto; }
.person .n { font-weight: 600; }
.person .r { font-size: 12px; color: var(--ink-2); }
.person .q { font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.person .need { font-size: 11.5px; color: #9a6700; }

/* 결재 */
.aprow { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-align: left; width: 100%; min-width: 0; }
.aprow:hover { border-color: var(--accent); }
.aprow .t { font-weight: 600; font-size: 13.5px; overflow-wrap: anywhere; }
.aprow .m { font-size: 12px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.chain { display: flex; gap: 6px; flex-wrap: wrap; }
.chain span { font-size: 11.5px; border-radius: 6px; padding: 2px 8px; background: var(--surface-2); color: var(--ink-2); }
.chain span.ok { background: color-mix(in srgb, var(--good) 16%, transparent); color: #0a6a0a; }
.chain span.now { background: color-mix(in srgb, var(--warn) 24%, transparent); color: #7a5200; }
.chain span.rej { background: color-mix(in srgb, var(--crit) 16%, transparent); color: var(--crit); }
.docpaper { background: #fff; color: #111; border: 1px solid var(--line); border-radius: 6px; padding: 24px 26px; font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', var(--font); font-size: 12.5px; box-shadow: var(--shadow); }
.docpaper h3 { text-align: center; font-size: 20px; letter-spacing: 0.3em; margin: 0 0 14px; }
.docpaper table { width: 100%; border-collapse: collapse; }
.docpaper td, .docpaper th { border: 1px solid #333; padding: 6px 8px; vertical-align: top; }
.docpaper th { background: #f0f0f0; width: 18%; text-align: center; font-weight: 600; }
.docpaper .sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 12px; border: 1px solid #333; }
.docpaper .sign div { border-right: 1px solid #333; padding: 6px 8px; text-align: center; }
.docpaper .sign div:last-child { border-right: 0; }
.docpaper .sign .role { font-size: 11px; color: #555; }
.docpaper .sign .who { font-weight: 600; margin: 2px 0; }
.docpaper .sign .st { font-size: 11.5px; min-height: 18px; }
.docpaper .sign .st.ok { color: #0a6a0a; font-weight: 600; }
.docpaper .sign .st.rej { color: #c0392b; font-weight: 600; }
.docpaper ul { margin: 4px 0 0 18px; padding: 0; }
.locked { opacity: 0.55; cursor: not-allowed; }
.toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.toggle input { margin: 0; }
.link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }

/* ---------- 앱(서버 버전) 추가 스타일 ---------- */
.flash { max-width: 1180px; margin: 12px auto 0; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.flash div { border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 6px; background: var(--accent-soft); color: var(--ink); }
.flash div.error { background: color-mix(in srgb, var(--crit) 14%, transparent); color: var(--crit); }
a { color: var(--accent); }
.nav a.badge-wrap { position: relative; }
.form label textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 8px 10px; min-height: 80px; width: 100%; font: inherit; color: inherit; resize: vertical; }
.form input[type=checkbox] { width: auto; }
.tl li .pubtag { font-size: 11px; color: var(--muted); margin-left: 6px; }
.tl li .pubtag.on { color: var(--accent); font-weight: 600; }
.tl form { display: inline; }
.tl button.link { background: none; border: 0; padding: 0; color: var(--accent); font-size: 11.5px; cursor: pointer; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .d { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px; min-height: 64px; font-size: 11.5px; min-width: 0; }
.cal .d.we { background: var(--surface-2); }
.cal .d b { display: block; font-size: 12px; }
.cal .d .t { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cal .d .k { color: var(--muted); }
.cal .hd { text-align: center; font-size: 11.5px; color: var(--muted); padding: 2px 0; }
.ownerrow { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.ownerrow input { flex: 1; }
.ownerrow input.share { flex: 0 0 70px; }
.sheet.small { font-size: 11px; }
.wide-form .form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .wide-form .form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .wide-form .form { grid-template-columns: 1fr; } .cal .d { min-height: 48px; } }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hist li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.audit { font-size: 12px; color: var(--ink-2); }
.audit code { font-size: 11px; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }
.bar { height: 10px; border-radius: 3px; background: var(--s1); }
.barrow { display: grid; grid-template-columns: 90px 1fr 70px; gap: 8px; align-items: center; font-size: 12.5px; padding: 3px 0; }
.barrow .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hero-wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: center; padding-block: 28px 10px; }
@media (max-width: 900px) { .hero-wrap { grid-template-columns: 1fr; } }
.installhint { font-size: 12px; color: var(--muted); }
@media (min-width: 761px) { .hide-desk { display: none !important; } }
@media (max-width: 760px) { .hide-phone { display: none !important; } }
