:root {
  --side: #2b2f2c;
  --side-2: #242825;
  --side-ink: #e7ebe6;
  --side-mute: #a3aaa4;
  --red: #c5162c;
  --red-deep: #9f1224;
  --bg: #f3f4f2;
  --card: #fff;
  --line: #e6e8e6;
  --ink: #1e2420;
  --mute: #6d756f;
  --amber: #b86e09;
  --green: #1f7a45;
  --blue: #1d4e89;
  --shadow: 0 8px 28px rgba(20, 24, 21, .12);
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", sans-serif;
}
* { box-sizing: border-box; }
html, body, #app { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif; font-size: 13px; line-height: 19px; -webkit-font-smoothing: antialiased; }
.num, table, .kpi strong { font-variant-numeric: tabular-nums; }
#app { min-height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }

.login-wrap { min-height: 100%; min-height: 100dvh; width: 100%; display: grid; place-items: center; background: linear-gradient(160deg, #1f2723, #3a403b 55%, #1f2723); padding: 24px; }
.login-card { width: min(420px, 100%); background: #fff; border-radius: 16px; padding: 28px 26px 22px; box-shadow: var(--shadow); }
.brand-mark { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.brand-mark b { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; background: #1f2723; color: #fff; letter-spacing: -.04em; }
.login-card h1 { margin: 0; font-size: 22px; }
.sub { color: var(--mute); margin: 4px 0 18px; font-size: 13px; }
label.f { display: block; font-size: 12px; color: var(--mute); margin: 10px 0 4px; }
input:not([type]), input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="time"], input[type="search"], select, textarea {
  width: 100%; height: 30px; border: 1px solid #d5dad7; border-radius: 3px; padding: 0 8px; background: #fff; font-size: 12.5px; line-height: 18px;
}
textarea { height: auto; min-height: 72px; padding: 8px; resize: vertical; }
.btn { border: 0; border-radius: 8px; padding: 9px 14px; background: var(--red); color: #fff; font-weight: 650; }
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid #d7dbd7; font-weight: 550; }
.btn.dark { background: #1f2723; }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn:disabled { opacity: .55; cursor: default; }
.role-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.role-row button { border: 1px solid #e1e4e1; background: #f7f8f7; border-radius: 999px; padding: 5px 10px; font-size: 12px; }
.role-row button.on { background: #860111; color: #fff; border-color: #860111; }
.fine { font-size: 12px; color: var(--mute); }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }

.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.shell.collapsed { grid-template-columns: 72px minmax(0, 1fr); }
.side { background: #2a2d2c; color: #c9cfcc; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; gap: 8px; align-items: center; padding: 16px 14px 12px; color: #fff; }
.side-brand .word { line-height: 1.05; }
.side-brand .word small { display: block; color: #c9cfcc; font-size: 10px; font-weight: 500; }
.side-brand .word b { font-size: 22px; letter-spacing: -.04em; }
.side-brand .sys { font-size: 12px; color: #c9cfcc; margin-left: 2px; }
.icon-btn { border: 0; background: transparent; color: var(--side-mute); width: 28px; height: 28px; border-radius: 6px; }
.nav { overflow: auto; padding: 4px 8px 12px; flex: 1; min-height: 0; }
.nav-group { width: 100%; text-align: left; color: #e7ebe6; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; font-size: 13.5px; }
.nav-group .scope { margin-left: auto; font-size: 10px; color: #d7b15a; border: 1px solid #6a5a32; border-radius: 4px; padding: 0 4px; line-height: 1.4; }
.nav-ico { width: 16px; height: 16px; flex: 0 0 16px; }
.nav-group .chev { margin-left: auto; width: 14px; height: 14px; color: #8b938e; }
.nav-group .scope + .chev { margin-left: 6px; }
.chev.up { transform: rotate(180deg); }
.nav-sub { display: none; padding: 2px 0 8px 12px; }
.nav-sub.open { display: block; }
.nav-sub button { width: 100%; text-align: left; color: #c9d0cb; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.nav-sub button.active, .nav-group.active { background: #c5162c; color: #fff; }
.shell.collapsed .nav-sub, .shell.collapsed .scope, .shell.collapsed .sys, .shell.collapsed .side-foot, .shell.collapsed .chev, .shell.collapsed .fab-text { display: none; }
.side-foot { padding: 10px 12px 14px; color: var(--side-mute); font-size: 11px; }

.main { min-width: 0; display: flex; flex-direction: column; background: #f6f7f6; }
.top { height: 52px; background: #e4e7e5; display: flex; align-items: center; gap: 10px; padding: 0 12px; position: sticky; top: 0; z-index: 5; }
.tabs { display: flex; gap: 4px; min-width: 0; overflow: auto; flex: 1; align-self: flex-end; height: 40px; }
.tab { height: 40px; min-width: 96px; max-width: 190px; border-radius: 5px 5px 0 0; padding: 0 12px; font-size: 13px; display: flex; align-items: center; gap: 6px; color: #5c6560; background: #d9dddb; border: 1px solid transparent; border-bottom: 0; white-space: nowrap; }
.tab.on { background: #f6f7f6; color: #860111; font-weight: 700; border-color: #e6e8e6; }
.tab i { font-style: normal; color: #98a; padding: 0 4px; }
.search { position: relative; width: 280px; flex: 0 0 280px; }
.search input { width: 100%; height: 32px; border-radius: 999px; padding: 0 36px 0 12px; background: #fff; border: 1px solid #d7dbd8; }
.search-pop { position: absolute; top: 36px; left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 8; }
.search-pop button { width: 100%; text-align: left; background: #fff; border: 0; padding: 8px 10px; display: block; }
.search-pop button:hover { background: #f6f7f6; }
.search-pop small { color: var(--mute); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 10px; font-size: 12px; }
.avatar { border: 0; background: #f3f4f2; border-radius: 999px; padding: 5px 10px; font-size: 12px; }
.drop { position: absolute; right: 12px; top: 46px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 220px; z-index: 9; padding: 6px; }
.drop button { width: 100%; text-align: left; background: #fff; border: 0; padding: 8px 10px; border-radius: 8px; }
.drop button:hover { background: #f6f7f6; }

.content { padding: 16px 18px 48px; min-width: 0; overflow: auto; }
.table-wrap { overflow: auto; }
.crumb { color: var(--mute); font-size: 12px; }
.page-h { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.page-h h1 { margin: 0; font-size: 18px; font-weight: 700; }
.sid { font-size: 11px; color: var(--mute); border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 2px 6px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.kpi { padding: 14px 12px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: #fff; text-align: left; min-width: 0; }
.kpi:last-child { border-right: 0; }
.kpi span { display: block; color: var(--mute); font-size: 12px; }
.kpi strong { font-size: 26px; letter-spacing: -.04em; }
.kpi em { font-style: normal; font-size: 13px; font-weight: 500; margin-left: 2px; }
.kpi.warn strong, td.warn { color: var(--amber); font-weight: 700; }
.kpi.hot strong { color: var(--red); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(240px, .75fr) minmax(220px, .7fr); gap: 12px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0; overflow: auto; }
.card h3 { margin: 0 0 8px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.card h3 button { border: 0; background: transparent; color: var(--blue); font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; color: var(--mute); font-size: 12px; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid #f0f1f0; vertical-align: middle; white-space: nowrap; }
tr.click:hover td { background: #fafafa; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; font-size: 12px; background: #eef1ef; color: #334; }
.badge.red { background: #fde8eb; color: #a31326; }
.badge.amber { background: #fff3df; color: #8a5a08; }
.badge.green { background: #e5f6ec; color: #146b38; }
.badge.blue { background: #e7f0fb; color: #1d4e89; }
.badge.gray { background: #eee; color: #555; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.flab { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mute); }
.vip { display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 4px; background: #1e2420; color: #fff; font-size: 10px; font-weight: 700; }
.late { color: var(--red); font-size: 11px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.filters select,
.filters input:not([type="hidden"]):not([type="checkbox"]) { height: 34px; }
.filters input:not([type]),
.filters input[type="text"],
.filters input[type="search"],
.filters input[type="number"],
.filters input[type="password"] {
  flex: 1 1 240px;
  width: 1px;
  min-width: min(100%, 220px);
  max-width: 100%;
}
.filters select,
.filters input[type="date"],
.filters input[type="time"],
.filters input[type="datetime-local"] { width: auto; min-width: 140px; flex: 0 0 auto; }
td select, td input:not([type="checkbox"]):not([type="hidden"]) { width: auto; min-width: 140px; max-width: 240px; }
.seg { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.seg button { border: 0; background: transparent; padding: 8px 12px; color: var(--mute); border-bottom: 2px solid transparent; }
.seg button.on { color: var(--ink); border-color: var(--red); font-weight: 700; }
.pager { display: flex; gap: 4px; justify-content: center; padding: 12px; }
.pager button { min-width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.pager button.on { background: var(--red); color: #fff; border-color: var(--red); }
.pager button:disabled { opacity: .35; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 250px; padding-top: 4px; }
.bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-col .g { display: flex; gap: 4px; align-items: flex-end; height: 210px; }
.bar-col .g span { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; font-size: 11px; color: #6d756f; line-height: 1; }
.bar-col .g span b { color: var(--red); font-weight: 700; }
.bar-col .g em { font-style: normal; }
.bar-col .g i, .stack i { width: 18px; }
.bar-col i { display: block; width: 18px; border-radius: 3px 3px 0 0; min-height: 2px; }
.stack { height: 210px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.stack i { width: 36px; border-radius: 2px 2px 0 0; min-height: 0; }
.stack i + i { border-radius: 0; }
.card.chart { min-height: 282px; }
.donut-row { display: flex; gap: 12px; align-items: center; }
.donut { width: 140px; height: 140px; border-radius: 50%; flex: 0 0 140px; display: grid; place-items: center; }
.donut span { width: 72px; height: 72px; border-radius: 50%; background: #fff; }
.bar-col i.a { background: #d9ddd8; }
.bar-col i.b { background: #5e6860; }
.bar-col i.c { background: var(--red); }
.legend { display: flex; gap: 10px; font-size: 12px; color: var(--mute); }
.todo button { width: 100%; display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f2f3f2; font-size: 13px; border-radius: 0; }
.guide-fab { position: relative; z-index: 2; flex: 0 0 auto; margin: 8px 12px 12px; width: auto; height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #860111; color: #fff; border-radius: 999px; font-size: 14px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.28); }
.guide-fab .fab-text { display: inline-flex; align-items: center; gap: 8px; }
.guide-fab .count { background: rgba(255,255,255,.15); border-radius: 999px; padding: 1px 6px; font-size: 11px; font-weight: 500; }
.shell.collapsed .guide-fab { width: 42px; margin: 8px auto 12px; padding: 0; }
.guide-back { z-index: 50; }
.guide-box { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border: 2px solid #860111; border-radius: 8px; padding: 0; box-shadow: 0 16px 40px rgba(0,0,0,.22); }
.guide-head { display: flex; align-items: center; gap: 8px; background: #1e2420; color: #fff; padding: 12px 16px; position: sticky; top: 0; }
.guide-head .fine { color: rgba(255,255,255,.65); }
.guide-head button { margin-left: auto; border: 0; background: transparent; color: rgba(255,255,255,.75); }
.guide-lead { padding: 12px 16px; margin: 0; border-bottom: 1px solid #eee; }
.guide-flow { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #eee; padding: 12px 16px; }
.guide-flow:hover { background: #fbf6f6; }
.guide-no { width: 24px; height: 24px; border-radius: 50%; border: 1px solid #ddd; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: 0 0 24px; }
.guide-no.done { background: #e7f5ec; color: #1f8a53; border-color: #1f8a53; }
.guide-go { color: #860111; font-size: 12px; font-weight: 700; flex: 0 0 auto; }
.guide-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.guide-chip { border: 1px solid #e4e6e4; background: #f6f7f6; border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.guide-help { background: #f6f7f6; align-items: center; }
.btn.guide-new { position: relative; }
.btn.guide-new::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: #c5162c; box-shadow: 0 0 0 2px #fff; }
.spot-layer { position: fixed; inset: 0; z-index: 60; }
.spot-hole { position: fixed; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(18, 22, 20, .55); pointer-events: none; }
.spot-card { position: fixed; width: 340px; background: #fff; border: 1px solid #1c2420; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 14px 16px 12px; z-index: 61; }
.spot-card b { font-weight: 700; }
.spot-card h4 { margin: 4px 0 8px; font-size: 14px; }
.spot-card p { margin: 0 0 8px; font-size: 13px; line-height: 1.45; }
.org-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; }
.org-item { width: 100%; display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; text-align: left; }
.org-item.on { background: #fde8eb; color: #860111; font-weight: 700; }
.lv { display: inline-flex; gap: 2px; }
.lv button, .lv.one, .lv.lock { border: 0; background: #f3f4f2; color: #66706a; border-radius: 4px; padding: 2px 6px; font-size: 11px; }
.lv button.on, .lv.one.on { background: #1e2420; color: #fff; }
.sch-wrap { overflow: auto; }
.sch { font-size: 11px; min-width: 980px; }
.sch th, .sch td { padding: 3px 2px; text-align: center; }
.sch .who { text-align: left; position: sticky; left: 0; background: #fff; min-width: 120px; }
.sch .rest { color: #b42318; }
.sch .off { color: #860111; font-weight: 700; }
.sch .wait { color: #b86e09; font-weight: 700; outline: 1px dashed #b86e09; outline-offset: -2px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calday { min-height: 72px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.calday.today { background: #fff6f7; }
.dealer-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 8px; align-items: center; width: 100%; text-align: left; }
.dealer-card .meta { flex: 1; min-width: 0; }
.load { height: 6px; background: #eee; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.load i { display: block; height: 100%; background: #860111; }
.tag { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: #fff3df; color: #8a5a08; font-size: 10px; font-weight: 700; }
.tag.rec { background: #e7f0fb; color: #1d4e89; }
.with-panel { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: start; }
.sidepanel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; position: sticky; top: 8px; }
.sidepanel h3 { margin: 0; font-size: 15px; }
.rcal { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 12px; }
.mcal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mcell { min-height: 68px; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-align: left; padding: 4px 6px; font-size: 12px; }
.mcell.on { outline: 2px solid var(--red); }
.mcell .n { font-weight: 700; }
.mcell .sub { color: var(--mute); font-size: 11px; }
.cellbtn { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; padding: 2px 0; }
.mini { font-size: 12px; color: var(--mute); margin: 4px 0; }
tr.on td { background: #fff6f7; }
.expand td { background: #fafafa; white-space: normal; }
.strike { text-decoration: line-through; color: var(--mute); }
.dealer-card.on { border-color: var(--red); background: #fff7f8; }
.checkline { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f3f3f3; }
.modal-back { position: fixed; inset: 0; background: rgba(17, 20, 18, .45); display: grid; place-items: center; z-index: 20; padding: 18px; }
.modal { width: min(560px, 100%); background: #fff; border-radius: 14px; padding: 16px 16px 14px; box-shadow: var(--shadow); max-height: min(86vh, 760px); overflow: auto; }
.modal.wide { width: min(880px, 100%); }
.modal h2 { margin: 0 0 8px; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.form-grid .full { grid-column: 1 / -1; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 12px; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #1f2723; color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 30; font-size: 13px; box-shadow: var(--shadow); }
.paper { width: min(820px, 100%); margin: 0 auto; background: #fff; border: 1px solid #ccc; padding: 28px 32px; }
.paper h2 { text-align: center; letter-spacing: .08em; }
.paper table td, .paper table th { border: 1px solid #ccc; }
.muted { color: var(--mute); }
.right { text-align: right; }
.star { border: 0; background: transparent; color: #c5a15a; font-size: 16px; }
.mobile { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #f6f7f6; padding-bottom: 64px; }
.mobile .grid-2, .mobile .split, .mobile .form-grid, .mobile .grid-3 { grid-template-columns: 1fr; }
.mobile input, .mobile select, .mobile textarea { min-width: 0; }
.mobile th, .mobile td { white-space: normal; }
.mobile header { background: #1f2723; color: #fff; padding: 16px; }
.mnav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--line); }
.mnav a, .mnav button { flex: 1; text-align: center; padding: 10px 4px; font-size: 12px; border: 0; background: #fff; text-decoration: none; }
.statline { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eee; font-size: 13px; }
.hide { display: none !important; }
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .search { width: 180px; flex-basis: 180px; }
}
@media print {
  .side, .top, .guide-fab, .spot-layer, .crumb, .page-h, .filters { display: none !important; }
  .shell { display: block; }
  .main { background: #fff; padding: 0; }
  .paper { border: 0; width: auto; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .split, .form-grid { grid-template-columns: 1fr; }
}
