/* ============================================================
   온라인 식·의약품 모니터링 — 정제된 SaaS 어드민 스타일
   라이트 사이드바 + 상단바 + 콘텐츠 패널 · 팔레트(네이비/에메랄드/레드) 유지
   ============================================================ */

:root {
  --navy:    #1B2A4A;
  --navy-2:  #233a63;
  --blue:    #3B6FB6;
  --emerald: #10B981;
  --emerald-d: #0e9f72;
  --emerald-tint: #E7F7F1;
  --amber:   #F59E0B;
  --amber-tint: #FDF3E3;
  --red:     #EF4444;
  --red-tint: #FDECEC;
  --blue-tint: #ECF1FA;

  --app-bg:  #F3F4F7;
  --panel:   #FFFFFF;
  --line:    #ECEDF1;
  --line-2:  #F4F5F7;
  --text:    #1F2433;
  --heading: #161B2B;
  --muted:   #6B7280;
  --muted-2: #9AA1AD;

  --sans: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --r-lg: 20px;
  --r:    10px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(20,26,43,.04);
  --shadow-pop: 0 4px 20px rgba(20,26,43,.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--app-bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2 { color: var(--heading); }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }

/* ---------- Sidebar (light) ---------- */
.sidebar {
  background: #FCFCFD; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 6px; }
.sb-logo { width: 132px; height: auto; display: block; }
.sb-logo-link { display: flex; }
.sb-collapse { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 8px; color: var(--muted-2); cursor: pointer; }
.sb-collapse:hover { color: var(--navy); border-color: #DCDEE3; }

.sb-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; margin-top: 12px; }
.sb-brand-title { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; padding: 6px 10px 8px; }
.sb-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--muted); font-size: 13.5px; font-weight: 500; transition: .14s;
}
.sb-link .ic { color: var(--muted-2); }
.sb-link:hover { background: #F2F3F6; color: var(--text); }
.sb-link:hover .ic { color: var(--text); }
.sb-link.active { background: #fff; color: var(--heading); font-weight: 600; box-shadow: var(--shadow); border: 1px solid var(--line); }
.sb-link.active .ic { color: var(--navy); }
.sb-link.disabled { color: var(--muted-2); cursor: default; }
.sb-link.disabled:hover { background: transparent; }
.sb-link .soon { margin-left: auto; font-size: 9.5px; font-style: normal; letter-spacing: .03em; background: #F0F1F4; color: var(--muted-2); padding: 2px 6px; border-radius: 5px; }

.sb-foot { padding-top: 10px; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.sb-avatar { width: 34px; height: 34px; border-radius: 9px; flex: none; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.sb-utext { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sb-utext strong { font-size: 12.5px; color: var(--heading); font-weight: 600; }
.sb-utext small { font-size: 11px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-signout { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted-2); border-radius: 8px; cursor: pointer; }
.sb-signout:hover { background: var(--red-tint); color: var(--red); }
.sb-foot form { margin: 0; }

/* 접힌 사이드바 (토글) */
.app.collapsed { grid-template-columns: 72px 1fr; }
.app.collapsed .sb-brand-title,
.app.collapsed .sb-logo-link,
.app.collapsed .sb-link span:not(.soon),
.app.collapsed .sb-link .soon,
.app.collapsed .sb-utext { display: none; }
.app.collapsed .sb-top { justify-content: center; }
.app.collapsed .sb-link,
.app.collapsed .sb-user { justify-content: center; }
.app.collapsed .sb-collapse .ic { transform: scaleX(-1); }

/* ---------- Main / topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; }
.crumbs { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.crumbs .sep { color: var(--muted-2); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs strong { color: var(--heading); font-weight: 600; }
.tb-right { display: flex; align-items: center; gap: 12px; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; height: 38px; padding: 0 11px; width: 280px; }
.search .ic { width: 16px; height: 16px; color: var(--muted-2); }
.search input { border: 0; outline: 0; background: transparent; font-family: var(--sans); font-size: 13px; color: var(--text); flex: 1; min-width: 0; }
.search input::placeholder { color: var(--muted-2); }
.search kbd { font-family: var(--sans); font-size: 11px; color: var(--muted-2); background: #F4F5F7; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.sync-wrap { position: relative; }
.sync { display: inline-flex; align-items: center; gap: 7px; font-family: var(--sans); font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 10px; height: 38px; padding: 0 11px; cursor: pointer; transition: .14s; }
.sync:hover { border-color: #DCDEE3; color: var(--text); }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); flex: none; }
.sync-dot.on { background: var(--emerald); box-shadow: 0 0 0 3px rgba(16,185,129,.16); }
.sync-v { font-variant-numeric: tabular-nums; }
.sync-caret { width: 13px; height: 13px; color: var(--muted-2); }
.badge-dot { position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; }

/* ---------- Sync status popover ---------- */
.popover { position: absolute; top: calc(100% + 8px); right: 0; width: 320px; max-height: 60vh; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop);
  z-index: 20; display: none; }
.popover.open { display: block; }
.pop-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2);
  font-size: 13px; font-weight: 600; color: var(--heading); }
.pop-err { font-size: 11px; font-weight: 700; color: var(--red); background: var(--red-tint); padding: 2px 8px; border-radius: 999px; }
.pop-list { list-style: none; margin: 0; padding: 6px; }
.pop-row { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-radius: 8px; }
.pop-row.is-err { background: var(--red-tint); }
.pop-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.pop-dot.ok { background: var(--emerald); }
.pop-dot.err { background: var(--red); }
.pop-name { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-time { flex: none; font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.pop-errmsg { font-size: 11px; color: var(--red); padding: 0 8px 8px 24px; word-break: break-all; }
.pop-empty { padding: 16px 10px; text-align: center; font-size: 12.5px; color: var(--muted-2); }

/* ---------- Content panel ---------- */
.content { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin: 0 24px 24px; padding: 26px 26px 32px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-headline h1 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.page-sub { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.page-tools { display: flex; align-items: center; gap: 12px; }

/* ---------- Period control ---------- */
.periods { display: inline-flex; background: #F4F5F7; border-radius: 10px; padding: 3px; gap: 2px; }
.periods a { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 6px 13px; border-radius: 7px; transition: .14s; }
.periods a:hover { color: var(--text); }
.periods a.active { background: #fff; color: var(--heading); box-shadow: var(--shadow); }
.daterange { display: inline-flex; align-items: center; gap: 6px; }
.daterange input[type=date] { font-family: var(--sans); font-size: 12.5px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 8px; height: 34px; padding: 0 10px; box-sizing: border-box; }
.daterange input[type=date]:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--blue-tint); }
.dr-sep { color: var(--muted-2); font-size: 12px; }
.dr-apply { font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: #fff; background: var(--navy); border: 0; border-radius: 8px; height: 34px; padding: 0 14px; cursor: pointer; transition: background .14s; }
.dr-apply:hover { background: var(--navy-2); }
.dr-apply:disabled { background: #CDD2DB; cursor: default; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.kpi-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.kpi-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.k-total .kpi-dot { background: var(--blue); }
.k-new   .kpi-dot { background: var(--emerald); }
.k-ai    .kpi-dot { background: var(--amber); }
.k-risk  .kpi-dot { background: var(--red); }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-val { display: flex; align-items: baseline; gap: 8px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--heading); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-val .unit { font-size: 15px; color: var(--muted-2); font-weight: 600; margin-left: -3px; }
.kpi-sub { margin-top: 10px; font-size: 12.5px; color: var(--muted-2); }
.k-risk .kpi-val { color: var(--red); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--emerald-d); background: var(--emerald-tint); }
.delta.down { color: var(--red); background: var(--red-tint); }
.delta.flat { color: var(--muted-2); background: #F1F2F5; }

/* ---------- Dashboard grid: 메인 + 우측 레일 ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.dash-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }
.dash-rail { display: grid; gap: 16px; align-content: start; }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head .meta { font-size: 12px; color: var(--muted-2); }
/* 표 위 섹션 헤더(제목 + 필터) — 표 카드와 분리되어 표 자체는 깨끗하게 유지 */
.tbl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tbl-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--heading); }
.chart-wrap { height: 290px; position: relative; }

/* ---------- Tables ---------- */
.dtable { width: 100%; border-collapse: collapse; }
.dtable th { text-align: left; font-size: 13px; color: #79828F; font-weight: 600; padding: 13px 12px; background: #F6F7F9; border-bottom: 1px solid var(--line); }

/* 데이터 테이블 전용 카드 — 헤더 밴드가 가장자리까지 꽉 차는 둥근 테두리 컨테이너 */
.table-card { padding: 0; overflow: hidden; }
.table-card .dtable th:first-child, .table-card .dtable td:first-child { padding-left: 20px; }
.table-card .dtable th:last-child, .table-card .dtable td:last-child { padding-right: 20px; }
.table-card .filter-empty { padding: 14px 20px; margin: 0; }
.dtable th.num, .dtable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dtable td { padding: 12px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable td.num { font-weight: 600; color: var(--heading); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 7px; background: var(--blue-tint); color: var(--navy-2); }
/* 품목 — 쿨 계열 */
.tag.tc-blue   { background: #E1E8FB; color: #2046B8; }
.tag.tc-indigo { background: #E8E1FC; color: #6034C4; }
.tag.tc-teal   { background: #D3F1E5; color: #0A8560; }
.tag.tc-cyan   { background: #D4ECF6; color: #0B6F92; }
/* 목적 — 웜 계열 */
.tag.tc-red    { background: #FBDCDC; color: #BC2E25; }
.tag.tc-amber  { background: #FAEAC4; color: #9F6304; }
.tag.tc-orange { background: #FBE0CC; color: #B5530F; }
.chips { display: inline-flex; gap: 2px; background: #F4F5F7; border-radius: 9px; padding: 3px; flex-wrap: wrap; }
.chip { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--muted); background: transparent; border: 0; padding: 5px 11px; border-radius: 7px; cursor: pointer; transition: .14s; }
.chip:hover { color: var(--text); }
.chip.active { background: #fff; color: var(--heading); box-shadow: var(--shadow); }
.filter-empty { margin: 14px 0 2px; font-size: 13px; color: var(--muted-2); text-align: center; }
.chtable .muted { color: var(--muted-2); }
.chtable .ch-name { font-weight: 600; color: var(--heading); }
.chtable tr.is-idle { opacity: .5; }
.pill-on, .pill-off { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.pill-on { background: var(--emerald-tint); color: var(--emerald-d); }
.pill-off { background: #EFF0F3; color: var(--muted-2); }

/* ---------- Category distribution bars ---------- */
.barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.barlist li { display: flex; flex-direction: column; gap: 6px; }
.bl-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.bl-name { font-weight: 600; color: var(--text); }
.bl-ct { color: var(--muted-2); font-weight: 600; }
.bl-track { height: 8px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.bl-fill { display: block; height: 100%; width: var(--w, 0%); background: var(--c, var(--navy)); border-radius: 6px; }

/* ---------- Ranked list (키워드·업체 공통) ---------- */
.rlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.rlist li { display: flex; gap: 12px; align-items: flex-start; }
.rlist-rank { flex: none; width: 22px; padding-top: 1px; font-size: 13px; font-weight: 700; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.rlist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.rlist-link { text-decoration: none; color: inherit; margin: -4px -6px; padding: 4px 6px; border-radius: 8px; transition: background .14s; }
.rlist-link:hover { background: var(--line-2); }
.rlist-link:hover .rlist-name { color: var(--navy); }
.rlist-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rlist-name { font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rlist-ct { flex: none; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.rlist-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag.sm { font-size: 11px; padding: 1px 7px; }
.rlist-track { height: 6px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.rlist-fill { display: block; height: 100%; width: var(--w, 0%); background: var(--navy); border-radius: 5px; }
.card-note { margin: 14px 0 0; font-size: 11px; color: var(--muted-2); line-height: 1.5; }

/* ---------- Recent high-risk feed (rail cards) ---------- */
.riskfeed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.riskfeed li { display: flex; flex-direction: column; gap: 7px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.riskfeed .rf-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.risk-badge { flex: none; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 7px; background: var(--red-tint); color: var(--red); text-align: center; font-variant-numeric: tabular-nums; }
.risk-badge[data-lv="10"], .risk-badge[data-lv="9"] { background: var(--red); color: #fff; }
.rf-title { display: block; font-size: 12.5px; font-weight: 600; color: var(--heading); line-height: 1.4; word-break: break-all; }
.rf-site { flex: none; font-size: 11px; color: var(--muted-2); }
.empty { color: var(--muted-2); font-size: 13px; padding: 14px 0; }

/* ---------- Chart empty state ---------- */
.chart-empty { height: 290px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 10px; }
.chart-empty .ic { width: 28px; height: 28px; stroke-width: 1.6; color: var(--muted-2); margin-bottom: 6px; }
.chart-empty .ce-title { font-size: 14px; font-weight: 600; color: var(--muted); margin: 0; }
.chart-empty .ce-sub { font-size: 12px; margin: 0; color: var(--muted-2); max-width: 280px; }

/* ---------- Seller detail ---------- */
.seller-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 16px; }
.sh-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sh-k { font-size: 12px; color: var(--muted-2); font-weight: 600; }
.sh-v { font-size: 14px; color: var(--heading); font-weight: 600; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sh-v.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.sh-full { grid-column: 1 / -1; }
.sh-full .sh-v { font-weight: 500; color: var(--text); }
@media (max-width: 720px) { .seller-head { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Search results ---------- */
.dtable .muted { color: var(--muted-2); }
.th-sort { display: inline-flex; align-items: center; gap: 2px; color: var(--muted-2); font-weight: 600; cursor: pointer; }
.th-sort:hover { color: var(--text); }
.th-sort.sorted { color: var(--navy); }
.searchtable td { vertical-align: middle; }
.searchtable .st-title { max-width: 0; width: 48%; }
.searchtable .st-title a { display: block; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.searchtable .st-title a:hover { color: var(--navy); }
.search-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  text-align: center; padding: 64px 20px; color: var(--muted-2); }
.search-empty .ic { width: 30px; height: 30px; stroke-width: 1.6; }
.search-empty p { margin: 0; font-size: 14px; }
.search-empty kbd { font-family: var(--sans); font-size: 11px; color: var(--muted); background: #F4F5F7; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 18px; flex-wrap: wrap; }
.pager .pg, .pager .pg-cur, .pager .pg-off { min-width: 36px; text-align: center; font-size: 13px; font-weight: 600; padding: 7px 11px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.pager .pg { color: var(--navy-2); border: 1px solid var(--line); background: #fff; }
.pager .pg:hover { border-color: #DCDEE3; background: #FAFBFC; }
.pager .pg-cur { background: var(--navy); color: #fff; font-weight: 700; border: 1px solid var(--navy); }
.pager .pg-off { color: var(--muted-2); border: 1px solid var(--line-2); background: #fff; }
.pager .pg-gap { color: var(--muted-2); padding: 0 2px; }

/* ---------- Sign in ---------- */
.signin-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 90% at 50% -20%, #233a63, var(--navy) 55%); }
.signin { width: 380px; max-width: 100%; background: #fff; border-radius: 18px; padding: 34px 32px; box-shadow: 0 24px 60px rgba(10,18,40,.4); }
.signin .brandrow { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 22px; }
.signin-logo { width: 162px; height: auto; display: block; }
.signin-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.signin h1 { font-size: 20px; margin: 0 0 4px; font-weight: 700; }
.signin .lede { font-size: 13px; color: var(--muted); margin: 0 0 22px; }
.signin label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 7px; }
.signin .field { margin-bottom: 15px; }
.signin input[type=email], .signin input[type=password] {
  width: 100%; font-family: var(--sans); font-size: 14px; color: var(--text);
  padding: 11px 13px; background: #fff; border: 1px solid var(--line); border-radius: 10px; transition: .14s;
}
.signin input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--blue-tint); }
.signin .btn { width: 100%; font-family: var(--sans); font-size: 14px; font-weight: 600; color: #fff; background: var(--navy); border: 0; border-radius: 10px; padding: 12px; cursor: pointer; transition: .14s; margin-top: 4px; }
.signin .btn:hover { background: var(--navy-2); }
.signin .alt { margin-top: 16px; font-size: 12.5px; }
.flash { font-size: 13px; padding: 10px 13px; border-radius: 10px; margin-bottom: 16px; }
.flash.alert { background: var(--red-tint); color: #c0392b; }
.flash.notice { background: var(--emerald-tint); color: var(--emerald-d); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .app { grid-template-columns: 72px 1fr; }
  .sb-brand-title, .sb-logo-link, .sb-link span:not(.soon), .sb-link .soon, .sb-utext { display: none; }
  .sb-top { justify-content: center; }
  .sb-link, .sb-user { justify-content: center; }
  .search { width: 180px; }
  .dash { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .kpis { grid-template-columns: 1fr; }
  .content { margin: 0 12px 16px; padding: 18px 16px 24px; }
  .topbar { padding: 12px 14px; }
  .search { display: none; }
}

/* 검색 활성 필터 칩 */
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.af-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; text-decoration: none; }
.af-chip:hover { border-color: var(--navy); }
.af-chip .af-x { color: var(--muted-2); font-size: 11px; }

/* 리포트 페이지 */
.chart-wrap.chart-tall { height: 360px; }
.report-cta { margin: 18px 0 4px; }
.btn-cta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: #fff; background: var(--navy); border-radius: 8px; padding: 10px 16px; text-decoration: none; }
.btn-cta:hover { background: var(--navy-2); }
.rlist-sub { color: var(--muted-2); font-weight: 400; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .report-grid { grid-template-columns: 1fr; } }

/* 품목군별 채널 분해 */
.cat-channel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.cat-channel-list li { display: flex; flex-direction: column; gap: 8px; }
.ccl-chs { display: flex; flex-wrap: wrap; gap: 8px; }
.ccl-ch { font-size: 12.5px; color: var(--text); background: #F6F7F9; border-radius: 6px; padding: 4px 10px; }
.ccl-ch b { color: var(--navy); }

/* 카드 → 리포트 진입 */
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head h2 { margin-right: auto; }
.card-more { font-size: 12.5px; font-weight: 600; color: var(--navy); text-decoration: none; white-space: nowrap; }
.card-more:hover { text-decoration: underline; }
.tbl-head .card-more { margin-left: auto; }
a.kpi { text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--navy); }
