/* css/app.css - 브루하우스 본사 콘솔: 어두운 관제실 화면, 각진 모서리(0~2px), 위쪽 가로 탭
   색: 숯 검정 · 판 · 토마토(경고 · 강조) · 오름 초록 · 크림 글자. 글꼴: 검은고딕(숫자 · 제목) + 본고딕 */
:root {
    --bg: #0F1012; --panel: #1A1C20; --panel-2: #24262B; --line: #2A2D33;
    --text: #F4EFE6; --muted: #A39E94; --hot: #F2542D; --hot-ink: #FF7A57; --up: #3DD68C; --mid: #E8B04B;
    --display: 'Black Han Sans', 'Noto Sans KR', sans-serif; --body: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, .num { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; }
.num-s { font-family: var(--display); font-weight: 400; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hot { color: var(--hot-ink) !important; }
.up { color: var(--up); font-weight: 700; }
.down { color: var(--hot-ink); font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.empty { color: var(--muted); margin: 6px 0; }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); background: var(--panel-2); border-radius: 2px; cursor: pointer; font-weight: 700; font-size: 14px; white-space: nowrap; }
.btn:hover { border-color: var(--text); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-hot { background: var(--hot); border-color: var(--hot); color: #fff; }
.btn-hot:hover { background: #D9431F; border-color: #D9431F; }
.btn-line { background: transparent; }
.link { background: none; border: 0; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lang { display: inline-flex; border: 1px solid var(--line); }
.lang button { border: 0; background: none; padding: 6px 10px; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
.lang button.on { background: var(--text); color: var(--bg); }

/* 로그인 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 80% 10%, rgba(242, 84, 45, 0.18), transparent 40%), var(--bg); }
.login-card { width: min(560px, 100%); background: var(--panel); border: 1px solid var(--line); padding: 34px 30px; }
.login-card h1 { font-size: 40px; margin: 22px 0 4px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; background: var(--hot); color: #fff; display: inline-grid; place-items: center; font-family: var(--display); align-self: center; }
.brand b { font-family: var(--display); font-weight: 400; font-size: 26px; }
.brand small { color: var(--muted); font-size: 14px; }
.login-picks { display: grid; gap: 2px; margin: 22px 0 16px; }
.login-pick { text-align: left; background: var(--panel-2); border: 0; border-left: 4px solid transparent; padding: 16px 18px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.login-pick:hover { border-left-color: var(--hot); }
.login-pick b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.login-pick small { color: var(--muted); }
.login-pick span { font-size: 14px; }
.login-foot { display: flex; justify-content: flex-end; margin-top: 14px; }

/* 틀 */
.top { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.top-row { max-width: 1320px; margin: 0 auto; padding: 16px 28px 6px; display: flex; align-items: center; gap: 16px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { font-size: 13px; color: var(--muted); }
.tabs { max-width: 1320px; margin: 0 auto; padding: 0 28px; display: flex; gap: 26px; overflow-x: auto; align-items: center; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 14px 0 12px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 700; white-space: nowrap; }
.tabs a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-bottom-color: var(--hot); }
.tabs em { font-style: normal; background: var(--hot); color: #fff; padding: 0 6px; font-size: 12px; }
.asof { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.view { max-width: 1320px; margin: 0 auto; padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 2px; }
.view > .head, .view > .chips { margin-bottom: 16px; }
.view > .kpis { margin-bottom: 2px; }
.foot { max-width: 1320px; margin: 0 auto; padding: 14px 28px 28px; font-size: 12px; color: var(--muted); }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.head h1 { font-size: 40px; margin: 0; width: 100%; }
.head:has(.search) h1, .head:has(.chips) h1 { width: auto; }
.head p { margin: 0; width: 100%; }
.back { color: var(--muted); text-decoration: none; font-size: 13px; width: 100%; }

/* 숫자 칸 · 판 */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--panel); padding: 20px 22px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
a.kpi:hover { background: var(--panel-2); }
.kpi small { color: var(--muted); font-size: 13px; }
.kpi b { font-size: 42px; line-height: 1.1; }
.kpi b i { font-style: normal; font-size: 20px; color: var(--muted); }
.kpi span { font-size: 13px; }
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2px; margin-bottom: 2px; }
.panel { background: var(--panel); padding: 22px; min-width: 0; margin-bottom: 2px; }
.split > .panel { margin-bottom: 0; }
.panel h2 { font-size: 20px; margin: 0 0 14px; }
.panel h2.mt { margin-top: 22px; }
.body { white-space: pre-line; line-height: 1.7; margin: 0; }

/* 표 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 500; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--panel-2); white-space: nowrap; }
.table .r { text-align: right; }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tag { display: inline-block; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.tag-ok { background: rgba(61, 214, 140, 0.14); color: var(--up); }
.tag-off { background: var(--panel-2); color: var(--muted); }
.tag-hot { background: rgba(242, 84, 45, 0.16); color: var(--hot-ink); }
.tag-mid { background: rgba(232, 176, 75, 0.15); color: var(--mid); }
b.tag-stock, b.tag-inspect, b.tag-order { color: var(--hot-ink); }
.gauge { display: inline-block; width: 110px; height: 8px; background: var(--panel-2); vertical-align: middle; }
.gauge span { display: block; height: 100%; background: var(--up); }
.gauge.low span { background: var(--hot); }
.spark { width: 90px; height: 26px; }
.spark polyline { fill: none; stroke: var(--up); stroke-width: 1.6; }

/* 그래프 */
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: #3A3D44; }
.chart .bar-hot { fill: var(--hot); }
.chart rect:hover { fill: var(--text); }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--body); }
.hbar { display: grid; grid-template-columns: 140px 1fr 80px; gap: 12px; align-items: center; padding: 8px 0; font-size: 14px; }
.hbar-track { height: 14px; background: var(--panel-2); }
.hbar-track span { display: block; height: 100%; background: var(--hot); }
.hbar b { text-align: right; }
.stack { display: flex; height: 26px; margin-bottom: 14px; }
.mix-coffee { background: var(--hot); } .mix-noncoffee { background: var(--mid); } .mix-dessert { background: var(--up); } .mix-goods { background: #8C8F96; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; }

/* 지도 */
.map { position: relative; height: 380px; background: #141518; overflow: hidden; }
.map-shape { position: absolute; inset: 6% 18%; width: 64%; height: 88%; }
.map-shape path, .map-shape ellipse { fill: #1E2024; stroke: #33363D; stroke-width: 0.6; }
.bubble { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(242, 84, 45, 0.18); border: 1px solid var(--hot); display: grid; place-items: center; align-content: center; text-align: center; text-decoration: none; line-height: 1.1; }
.bubble:hover { background: rgba(242, 84, 45, 0.32); }
.bubble b { font-size: 24px; }
.bubble small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.bubble small + small { color: var(--text); }

/* 할 일 · 목록 */
.todos { display: grid; gap: 2px; }
.todo { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--panel-2); padding: 12px 14px; font-size: 14px; }
.todo a { font-size: 13px; color: var(--text); white-space: nowrap; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--panel-2); text-decoration: none; }
.row b { display: block; }
.row small { color: var(--muted); font-size: 13px; }
.link-row:hover b { text-decoration: underline; text-underline-offset: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 2px; }
.chip { background: var(--panel); border: 0; padding: 9px 14px; cursor: pointer; font-weight: 700; color: var(--muted); }
.chip.on { background: var(--text); color: var(--bg); }
span.chip { cursor: default; color: var(--text); }
.search input { height: 40px; width: 260px; max-width: 100%; background: var(--panel); border: 1px solid var(--line); padding: 0 12px; }

/* 입력 */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form input:not([type="radio"]):not([type="checkbox"]), .form select, .form textarea { min-height: 42px; background: var(--bg); border: 1px solid var(--line); padding: 0 12px; color: var(--text); font-size: 15px; }
.form textarea { padding: 10px 12px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--text); }
.form .inline { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.checks fieldset { border: 1px solid var(--line); padding: 10px 12px; margin: 0; }
.checks legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.dots { display: flex; gap: 4px; }
.dots label { flex-direction: row; }
.dots input { position: absolute; opacity: 0; }
.dots span { display: grid; place-items: center; width: 34px; height: 34px; background: var(--panel-2); color: var(--text); font-family: var(--display); cursor: pointer; }
.dots input:checked + span { background: var(--hot); color: #fff; }
.dots input:focus-visible + span { outline: 2px solid var(--text); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; font-weight: 700; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }

@media (max-width: 1000px) {
    .split { grid-template-columns: minmax(0, 1fr); }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .top-row, .tabs, .view, .foot { padding-left: 16px; padding-right: 16px; }
    .who, .asof, .top .brand small { display: none; }
    .brand b { white-space: nowrap; font-size: 22px; }
    .tabs { gap: 18px; }
    .tabs a svg { display: none; }
    .head h1 { font-size: 32px; }
    .kpi b { font-size: 32px; }
    .kpis-3 { grid-template-columns: minmax(0, 1fr); }
    .map { height: 300px; }
    .hbar { grid-template-columns: 90px 1fr 64px; }
    .checks { grid-template-columns: minmax(0, 1fr); }
}
