:root {
  --bg: #f6f5f1; --card: #ffffff; --text: #1f1e1c; --muted: #6b6a65; --line: #e3e1da;
  --accent: #185fa5; --accent-bg: #e6f1fb; --warn: #854f0b; --warn-bg: #faeeda;
  --ok: #3b6d11; --ok-bg: #eaf3de; --danger: #a32d2d; --danger-bg: #fcebeb; --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1b1a; --card: #262624; --text: #ecebe6; --muted: #a3a29c; --line: #3a3936;
    --accent: #85b7eb; --accent-bg: #0c447c; --warn: #fac775; --warn-bg: #633806;
    --ok: #c0dd97; --ok-bg: #27500a; --danger: #f7c1c1; --danger-bg: #791f1f; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-size: 16px; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 12px; }
h2 { font-size: 17px; font-weight: 600; margin: 20px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ic { width: 22px; height: 22px; flex: none; }

/* 바깥 틀: 폰 = 위 제목 + 아래 메뉴 / 컴퓨터 = 왼쪽 메뉴 */
.shell { min-height: 100vh; }
.side { display: none; }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.top .brand { font-weight: 600; }
.top-menu { color: var(--text); display: flex; }
.page { padding: 16px 16px 96px; max-width: 980px; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid;
  grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 2px calc(6px + env(safe-area-inset-bottom)); }
.bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted);
  font-size: 11px; padding: 4px 0; white-space: nowrap; }
.bottom a.on { color: var(--accent); }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    background: var(--card); border-right: 1px solid var(--line); padding: 16px 12px; }
  .side .brand { font-weight: 600; font-size: 17px; margin: 0 8px 16px; }
  .side nav { display: flex; flex-direction: column; gap: 1px; flex: 1; min-height: 0; overflow-y: auto; }  /* 메뉴가 길면 메뉴만 스크롤 */
  .side nav a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; flex-shrink: 0; border-radius: var(--r); color: var(--text); }
  .side nav a:hover { background: var(--bg); }
  .side nav a.on { background: var(--accent-bg); color: var(--accent); }
  .side-line { border-top: 1px solid var(--line); margin: 8px 4px; }
  .side-group { font-size: 11px; color: var(--muted); margin: 12px 8px 2px; }
  .side-group:first-child { margin-top: 2px; }
  .side-me { border-top: 1px solid var(--line); padding: 12px 8px 0; display: flex; flex-direction: column; gap: 4px; }
  .top, .bottom { display: none; }
  .page { padding: 28px 32px; }
}

/* 카드, 표, 입력 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.stat .k { font-size: 13px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 600; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: var(--danger-bg); color: var(--danger); }
.flash { background: var(--ok-bg); color: var(--ok); padding: 10px 14px; border-radius: var(--r); margin-bottom: 12px; }
.error { background: var(--danger-bg); color: var(--danger); padding: 10px 14px; border-radius: var(--r); margin-bottom: 12px; }
.notice { background: var(--warn-bg); color: var(--warn); padding: 12px 14px; border-radius: var(--r); margin-bottom: 12px; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 4px; }
input[type=text], input[type=password], select { width: 100%; font: inherit; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--text); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
.check input { width: 20px; height: 20px; }
button, .btn { font: inherit; padding: 10px 16px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; display: inline-block; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { button.primary, .btn.primary { color: #042c53; } }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-align: left; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
table.log { width: 100%; border-collapse: collapse; font-size: 14px; }
table.log td, table.log th { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }

/* 누르는 선택지 (라디오를 버튼처럼) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); color: var(--text); font-size: 15px; cursor: pointer; }
.chip input[type=checkbox]:checked + span::before { content: "✓ "; }
.chip input:checked + span { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); }
.auto { background: var(--bg); border-radius: var(--r); padding: 8px 12px; font-size: 14px; color: var(--muted); margin-top: 6px; }
input[type=date], input[type=number], textarea { width: 100%; font: inherit; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--text); }
textarea { min-height: 70px; }
.mcard { display: block; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 10px 12px; margin-bottom: 8px; }
.mrow { display: flex; gap: 6px; align-items: stretch; margin-bottom: 8px; }
.mrow .mcard { flex: 1; min-width: 0; margin-bottom: 0; }
.churn-btn { flex: 0 0 52px; display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 12px; line-height: 1.3; color: var(--muted); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); text-decoration: none; }
.churn-btn:hover { color: var(--text); border-color: var(--muted); }
.mcard .top-line { display: flex; justify-content: space-between; gap: 8px; }
.mcard .sub { font-size: 13px; color: var(--muted); margin: 2px 0 4px; }
.badge.info { background: var(--accent-bg); color: var(--accent); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--text); font-size: 14px; background: var(--card); }
.tabs a.on { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.searchbar { display: flex; gap: 6px; margin-bottom: 10px; }
.searchbar input, .searchbar select { flex: 1; }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.right { text-align: right; white-space: nowrap; flex: none; }
.neg { color: var(--danger); }
.inline { display: inline; }

/* 스케줄표 */
.sched-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; }
table.sched { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 12px; }
table.sched.team { width: auto; min-width: 100%; }
table.sched th, table.sched td { border: 1px solid var(--line); padding: 2px; vertical-align: top; }
table.sched th { background: var(--bg); font-weight: 600; white-space: nowrap; }
table.sched th.t { position: sticky; left: 0; z-index: 1; width: 46px; font-weight: 500; color: var(--muted); }
table.sched.team th.tr { min-width: 70px; font-weight: 500; }
table.sched .today { background: color-mix(in srgb, var(--accent-bg) 45%, transparent); }
table.sched td { height: 30px; }
.lz { display: block; border-radius: 6px; padding: 2px 4px; margin-bottom: 2px; color: var(--text); line-height: 1.3; overflow: hidden; }
.lz .seq { font-size: 11px; opacity: .85; }
.k-pt { background: var(--accent-bg); color: var(--accent); }
.k-etc { background: var(--warn-bg); color: var(--warn); }
.k-work { background: var(--bg); color: var(--muted); }
.s-완료 { background: var(--ok-bg); color: var(--ok); }
.s-취소 { text-decoration: line-through; opacity: .55; }
.s-노쇼 { background: var(--danger-bg); color: var(--danger); }
.lz[draggable="true"] { cursor: grab; }
.lz.dragging { opacity: .4; }
td.drop-on { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-bg); }
.add { display: block; text-align: center; color: var(--line); font-size: 16px; line-height: 24px; }
.add:hover { color: var(--accent); background: var(--accent-bg); border-radius: 6px; }
.lrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qbtns { display: flex; gap: 6px; margin-top: 8px; }
.qbtns form { flex: 1; } .qbtns button { width: 100%; padding: 8px 4px; }

.ask { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 12px;
  background: var(--warn-bg); color: var(--warn); border-radius: var(--r); font-size: 14px; }
.ask span, .ask label, .ask input[type=text] { flex: 1 1 100%; }
[hidden] { display: none !important; }
.mpick { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.mpick button { text-align: left; padding: 9px 12px; }
input[type=search] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--card); color: var(--text); }

/* 로그인 같은 메뉴 없는 화면 */
.plain { max-width: 420px; margin: 0 auto; padding: 48px 20px; }
.plain-brand { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 24px; }
.temp-pw { font-family: Consolas, monospace; font-size: 26px; letter-spacing: 2px; background: var(--bg);
  padding: 12px; border-radius: var(--r); text-align: center; margin: 12px 0; }

/* 매출·분석 · 팀 현황 묶음 탭 (2026-11-17 메뉴 정리) */
.hub { margin-bottom: 10px; }
.hub-title { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
