/* facnroll 콘솔 공통 스타일 — 스티비 콘솔 레이아웃 기준 */
:root {
  --c-bg: #ffffff;
  --c-side: #ffffff;
  --c-line: #e9ebee;
  --c-line-strong: #d5d9de;
  --c-text: #1f2329;
  --c-sub: #6b7280;
  --c-mute: #9aa1ab;
  --c-hover: #f3f4f6;
  --c-active: #eef0f3;
  --c-primary: #f25a55;
  --c-primary-dark: #dc4540;
  --c-blue: #3d7be0;
  --c-blue-bg: #eaf1fd;
  --c-orange: #f2a33a;
  --c-yellow-bg: #fff4d6;
  --c-yellow-text: #8a6100;
  --c-danger: #e0453f;
  --c-danger-bg: #fdecec;
  --gnb-h: 56px;
  --lnb-w: 200px;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--c-text); background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* 개발 모드 띠 */
.dev-banner {
  background: #2b2f36; color: #fff; font-size: 12px; text-align: center; padding: 4px 12px;
}
.dev-banner b { color: #ffd166; }

/* GNB */
.gnb {
  height: var(--gnb-h); display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--c-line); background: #fff;
  position: sticky; top: 0; z-index: 30;
}
.gnb-logo { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 20px; letter-spacing: -0.5px; }
.gnb-logo .mark {
  width: 22px; height: 22px; border-radius: 50%; background: var(--c-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.gnb-right { display: flex; align-items: center; gap: 18px; }
.gnb-bell { position: relative; display: inline-flex; color: var(--c-sub); }
.gnb-bell .dot { position: absolute; top: -2px; right: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--c-primary); }

/* 드롭다운 */
.dropdown { position: relative; }
.dropdown-toggle {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer; padding: 6px 4px;
}
.dropdown-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: #fff;
  border: 1px solid var(--c-line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.08); padding: 6px 0; z-index: 40;
}
.dropdown.open > .dropdown-menu { display: block; }
.dropdown-menu .menu-item, .dropdown-menu button.menu-item {
  display: block; width: 100%; text-align: left; padding: 8px 16px; background: none; border: 0; cursor: pointer; font-size: 13.5px;
}
.dropdown-menu .menu-item:hover { background: var(--c-hover); }
.dropdown-menu .menu-sep { height: 1px; background: var(--c-line); margin: 6px 0; }
.dropdown-menu .menu-head { padding: 10px 16px; font-size: 13px; }
.dropdown-menu .menu-head .sub { color: var(--c-sub); font-size: 12px; }
.menu-item.is-disabled { color: var(--c-mute); cursor: default; }
.menu-item .soon { font-size: 11px; color: var(--c-mute); margin-left: 4px; }

/* 전체 틀 */
.shell { display: flex; min-height: calc(100vh - var(--gnb-h)); }
.lnb {
  width: var(--lnb-w); flex: 0 0 var(--lnb-w); border-right: 1px solid var(--c-line); background: var(--c-side);
  padding: 14px 12px; display: flex; flex-direction: column; position: sticky; top: var(--gnb-h);
  height: calc(100vh - var(--gnb-h));
}
.lnb .new-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px;
  background: var(--c-active); border: 0; border-radius: var(--radius); cursor: pointer; font-size: 13.5px;
}
.lnb .new-btn .lbl { display: inline-flex; align-items: center; gap: 8px; }
.lnb .dropdown-menu { left: 0; right: auto; min-width: 176px; }
.lnb nav { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.lnb-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius); font-size: 14px;
}
.lnb-link:hover { background: var(--c-hover); }
.lnb-link.active { background: var(--c-active); font-weight: 600; }
.lnb-link svg, .lnb .new-btn svg { flex: 0 0 auto; }
.lnb-foot { margin-top: auto; border-top: 1px solid var(--c-line); padding-top: 10px; text-align: right; }
.lnb-collapse { background: none; border: 0; cursor: pointer; color: var(--c-sub); padding: 4px 6px; }
body.lnb-mini { --lnb-w: 64px; }
body.lnb-mini .lnb .txt, body.lnb-mini .lnb .new-btn .caret { display: none; }
body.lnb-mini .lnb .new-btn, body.lnb-mini .lnb-link { justify-content: center; }
body.lnb-mini .lnb-collapse svg { transform: rotate(180deg); }

.main { flex: 1; min-width: 0; padding: 40px 32px 80px; }
.container { max-width: 1000px; margin: 0 auto; }

/* 페이지 머리 */
.page-title { font-size: 26px; font-weight: 700; margin: 0 0 28px; letter-spacing: -0.4px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-title { font-size: 17px; font-weight: 700; margin: 0 0 12px; }
.section-title .hint { font-size: 12px; color: var(--c-mute); font-weight: 400; margin-left: 6px; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px;
  border-radius: var(--radius); border: 1px solid var(--c-line-strong); background: #fff; cursor: pointer; font-size: 13.5px; white-space: nowrap;
}
.btn:hover { background: var(--c-hover); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-dark { background: #3a3f47; border-color: #3a3f47; color: #fff; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; }

/* 카드·지표 */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card { background: #f7f8fa; border-radius: 8px; padding: 18px 20px; }
.card .k { font-size: 12.5px; color: var(--c-sub); }
.card .v { font-size: 30px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -0.5px; }
.card .d { font-size: 12px; color: var(--c-mute); }
.panel { border: 1px solid var(--c-line); border-radius: 8px; padding: 20px; margin-bottom: 28px; }

/* 빈 상태 */
.empty { text-align: center; padding: 48px 20px; border: 1px solid var(--c-line); border-radius: 8px; }
.empty .ico {
  width: 44px; height: 44px; border-radius: 50%; background: var(--c-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.empty h3 { margin: 0 0 6px; font-size: 16px; }
.empty p { margin: 0; color: var(--c-sub); font-size: 13px; }
.empty .btn { margin-top: 16px; }

/* 게이지 */
.gauge { height: 8px; background: #eceef1; border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.gauge > span { display: block; height: 100%; background: var(--c-blue); border-radius: 99px; }
.gauge.warn > span { background: var(--c-orange); }
.gauge.full > span { background: var(--c-danger); }

/* 필터 바 */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--c-line-strong); color: var(--c-text); font-size: 13.5px; }
.filters .f { display: inline-flex; align-items: center; gap: 4px; color: var(--c-text); }

/* 탭 */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--c-line); margin-bottom: 28px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 0; font-size: 14px; color: var(--c-sub); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--c-text); font-weight: 600; border-color: var(--c-text); }

/* 폼 */
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-row label.btn { display: inline-flex; margin-bottom: 0; font-weight: 400; } /* 파일 올리기 버튼: 글자 상하 가운데 */
.input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--c-line-strong); border-radius: var(--radius); background: #fff;
}
.input:focus { outline: none; border-color: var(--c-text); }
.input.is-invalid { border-color: var(--c-danger); }
.field-error { color: var(--c-danger); font-size: 12.5px; margin-top: 5px; }
.help { color: var(--c-mute); font-size: 12px; margin-top: 5px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
select.input { padding-right: 8px; }
.filter-select { height: 34px; width: auto; border-color: var(--c-line); font-size: 13px; }
textarea.input { height: auto; resize: vertical; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* 알림 */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 13.5px; }
.alert-success { background: #e8f6ee; color: #1f7a45; }
.alert-error { background: var(--c-danger-bg); color: var(--c-danger); }
.alert-warn { background: var(--c-yellow-bg); color: var(--c-yellow-text); }

/* 표 */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--c-line); text-align: left; }
.table th { color: var(--c-sub); font-weight: 600; font-size: 12.5px; background: #fafbfc; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.badge-blue { background: var(--c-blue-bg); color: var(--c-blue); }
.badge-yellow { background: var(--c-yellow-bg); color: var(--c-yellow-text); }
.badge-gray { background: var(--c-active); color: var(--c-sub); }

/* 로그인 */
.guest { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f7f8fa; padding: 24px 16px; }
.guest-box { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--c-line); border-radius: 12px; padding: 36px 32px; }
.guest-box .gnb-logo { justify-content: center; margin-bottom: 8px; }
.guest-box .sub { text-align: center; color: var(--c-sub); font-size: 13px; margin-bottom: 28px; }

/* 모달 */
.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(17, 20, 24, .45); z-index: 60;
  align-items: flex-start; justify-content: center; padding: 60px 16px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: 10px; width: 100%; max-width: 520px; box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--c-line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--c-sub); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--c-line); }

/* 주소록 카드 */
.list-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 4px; border-bottom: 1px solid var(--c-line);
}
.list-card .name { font-size: 17px; font-weight: 700; }
.list-card .meta { font-size: 12.5px; color: var(--c-sub); margin-top: 4px; }
.list-card .meta b { color: var(--c-text); font-weight: 600; margin-right: 4px; }
.list-card .count { text-align: right; min-width: 70px; }
.list-card .count .k { font-size: 12px; color: var(--c-sub); }
.list-card .count .v { font-size: 22px; font-weight: 700; }
.list-card .actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); border: 0; background: var(--c-active); cursor: pointer; }
.icon-btn:hover { background: #e3e6ea; }

/* 표 도구 */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.toolbar .left, .toolbar .right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--c-line-strong); }
.table td.nowrap, .table th { white-space: nowrap; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; color: #fff; margin: 1px 2px 1px 0; white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; color: var(--c-sub); }
.pager nav { display: flex; gap: 4px; }
.pager a, .pager span.cur { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius); padding: 0 8px; }
.pager a:hover { background: var(--c-hover); }
.pager span.cur { background: var(--c-active); color: var(--c-text); font-weight: 600; }
.status-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.status-tabs a { padding: 6px 12px; border-radius: 99px; font-size: 13px; background: var(--c-active); color: var(--c-sub); }
.status-tabs a.active { background: var(--c-text); color: #fff; }

/* 막대 그래프 */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 18px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; color: var(--c-sub); }
.bars .bar span.fill { width: 100%; max-width: 34px; background: #2ec4b6; border-radius: 3px 3px 0 0; min-height: 2px; }
.bars .bar .num { margin-bottom: 4px; color: var(--c-text); }
.bars .bar .lbl { margin-top: 6px; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--c-sub); }
.kv dd { margin: 0; }
@media (max-width: 640px) { .stat-row { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; } }

.floating-help {
  position: fixed; right: 20px; bottom: 20px; width: 44px; height: 44px; border-radius: 50%; background: #2b2f36; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; box-shadow: 0 6px 16px rgba(0,0,0,.2);
}

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 28px 16px 60px; }
}
@media (max-width: 640px) {
  body { --lnb-w: 64px; }
  .lnb .txt, .lnb .new-btn .caret { display: none; }
  .lnb .new-btn, .lnb-link { justify-content: center; }
  .gnb-right .ws-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cards { grid-template-columns: 1fr; }
}

/* 24시간 그래프 · 비율 막대 */
.hourly { display: flex; align-items: flex-end; gap: 3px; height: 150px; }
.hourly .h { flex: 1; display: flex; flex-direction: column; height: 100%; }
.hourly .pair { flex: 1; display: flex; align-items: flex-end; gap: 1px; }
.hourly .pair span { flex: 1; min-height: 1px; border-radius: 2px 2px 0 0; }
.hourly .o, .legend i.o { background: var(--c-blue); }
.hourly .c, .legend i.c { background: #2ec4b6; }
.hourly .lbl { height: 16px; font-size: 10.5px; color: var(--c-sub); text-align: left; padding-top: 3px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--c-sub); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.share-row { display: grid; grid-template-columns: 90px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; margin: 6px 0; }
.share-row b { text-align: right; font-weight: 600; }

/* 알림 */
.gnb-bell { position: relative; border: 0; background: none; cursor: pointer; }
.bell-count { position: absolute; top: -4px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--c-danger); color: #fff; font-size: 10.5px; line-height: 17px; text-align: center; font-weight: 700; }
.noti-menu { min-width: 340px; max-width: 360px; right: 0; left: auto; }
.noti-item { display: flex !important; gap: 10px; align-items: flex-start; white-space: normal; }
.noti-item .tx { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.noti-item .tx b { font-weight: 600; }
.noti-item .tx small { color: var(--c-sub); font-size: 12px; }
.noti-item.unread, .noti-card.unread { background: #f3f7ff; }
.noti-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--c-blue); }
.noti-dot.lv-success { background: #2ec4b6; } .noti-dot.lv-warn { background: var(--c-orange); } .noti-dot.lv-error { background: var(--c-danger); }
.noti-card { color: inherit; text-decoration: none; }
.noti-card .noti-dot { margin: 0 6px 1px 0; }
.link-btn { border: 0; background: none; color: var(--c-blue); cursor: pointer; font-size: 12.5px; padding: 0; }

.tag-chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; color: var(--tag); background: color-mix(in srgb, var(--tag) 12%, white); text-decoration: none; }
label .tag-chip { margin-left: 0; }

/* 막대가 많을 때(통계 20개 등) 패널 밖으로 넘치지 않게 */
.bars { gap: clamp(3px, 1vw, 10px); }
.bars .bar { min-width: 0; }
.bars .bar .num, .bars .bar .lbl { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: clip; font-size: 10.5px; }

/* 사용자 매뉴얼 */
.manual { display: flex; gap: 32px; align-items: flex-start; }
.manual-toc { position: sticky; top: 76px; width: 210px; flex: none; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 13px; padding-right: 6px; }
.manual-toc-title { font-weight: 700; margin-bottom: 8px; }
.manual-toc a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--c-sub); text-decoration: none; line-height: 1.4; }
.manual-toc a.lv1 { color: var(--c-text); font-weight: 600; margin-top: 8px; }
.manual-toc a.lv2 { padding-left: 18px; font-size: 12.5px; }
.manual-toc a:hover { background: var(--c-hover); }
.manual-toc a.on { background: #fdeceb; color: #e0453f; }
.manual-body { flex: 1; min-width: 0; max-width: 980px; }
.manual-sec { padding-top: 16px; margin-bottom: 36px; scroll-margin-top: 70px; }
.manual-h2 { font-size: 22px; margin: 0 0 8px; padding-bottom: 10px; border-bottom: 2px solid var(--c-line); }
.manual-shot { margin: 28px 0 40px; scroll-margin-top: 70px; }
.manual-shot h3 { font-size: 17px; margin: 0 0 6px; }
.manual-desc { margin: 0 0 12px; font-size: 14px; color: var(--c-sub); line-height: 1.7; }
.manual-img { display: block; border: 1px solid var(--c-line); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.manual-img img { display: block; width: 100%; height: auto; }
.manual-items { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.manual-items li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.6; }
.manual-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 11px; background: #f25a55; color: #fff; font-size: 12.5px; font-weight: 700; margin-top: 1px; }
.manual-tip { margin-top: 10px; padding: 10px 14px; background: #fff8e6; border-radius: 8px; font-size: 13.5px; line-height: 1.6; }
.manual-video { background: #000; border-radius: 10px; overflow: hidden; }
.manual-video video { display: block; width: 100%; aspect-ratio: 16 / 10; }
.manual-chapters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 6px; }
.manual-chapter { border: 1px solid var(--c-line); background: #fff; border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--c-text); }
.manual-chapter b { color: #e0453f; margin-right: 4px; }
.manual-chapter:hover { border-color: #f25a55; }
video::cue { font-family: 'Malgun Gothic', sans-serif; font-size: 18px; background: rgba(0,0,0,.65); }
@media (max-width: 900px) { .manual-toc { display: none; } }
.lnb-sep { height: 1px; background: var(--c-line); margin: 10px 8px; }
