/* ==========================================================================
   AILO Dashboard D30 — 뷰티커머스 (화장품 온라인 매출·리뷰·캠페인·재고)
   레이아웃: 상단 가로 내비 + 여백 넓은 에디토리얼 그리드(박스 없이 헤어라인 구획)
   타이포: Noto Serif KR·Cormorant Garamond(제목) + Pretendard(수치) / 컬러: 로즈 베이지 + 차콜
   ========================================================================== */

:root {
  --ailo-bg: #f6efe9;
  --ailo-fg: #2a2426;
  --ailo-muted: #7a6c68;
  --ailo-line: #e3d6cd;
  --ailo-accent: #2a2426;

  --d30-serif: "Noto Serif KR", "Cormorant Garamond", serif;
  --d30-latin: "Cormorant Garamond", "Noto Serif KR", serif;
  --d30-paper: #fcf8f5;
  --d30-blush: #efe2da;
  --d30-rose: #b8506d;
  --d30-rose-soft: #f3dfe3;
  --d30-ink-2: #4a4043;
  --d30-hair: #ecdfd7;

  /* 차트 계열(로즈 베이지 표면 검증 통과: 로즈/블루/앰버/바이올렛/그린) */
  --d30-s1: #b8506d;
  --d30-s2: #3a6fb5;
  --d30-s3: #c47a1e;
  --d30-s4: #7a5cc0;
  --d30-s5: #2e8a5e;
  --d30-prev: #cdbfb8;
  --d30-neutral: #d8ccc5;

  --d30-good: #2e7d55;
  --d30-warn: #a8620f;
  --d30-bad: #b3263e;
}

html { scroll-behavior: auto; }
body { background: var(--ailo-bg); font-size: 14px; }
.serif { font-family: var(--d30-serif); }
.wrap { max-width: 1360px; margin-inline: auto; padding-inline: clamp(16px, 3.4vw, 48px); }

/* ===== 헤더 / 가로 내비 ===== */
.hd { position: sticky; top: 0; z-index: 100; background: rgba(246, 239, 233, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ailo-line); }
.hd__in { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px); height: 72px; }
.brand { display: flex; flex-direction: column; line-height: 1; white-space: nowrap; }
.brand b { font-family: var(--d30-serif); font-weight: 600; font-size: 20px; letter-spacing: -.02em; }
.brand small { font-family: var(--d30-latin); font-style: italic; font-size: 13px; color: var(--ailo-muted); letter-spacing: .08em; margin-top: 3px; }
.gnb { display: flex; gap: clamp(12px, 1.6vw, 26px); height: 100%; }
.gnb a { position: relative; display: flex; align-items: center; height: 100%; font-size: 14px; color: var(--ailo-muted); white-space: nowrap; font-weight: 500; }
.gnb a:hover { color: var(--ailo-fg); }
.gnb a[aria-current="page"] { color: var(--ailo-fg); font-weight: 700; }
.gnb a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ailo-fg); }
.gnb .gnb__n { font-size: 10.5px; color: var(--d30-rose); font-weight: 700; margin-left: 3px; align-self: flex-start; margin-top: 22px; }
.hd__tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.srch { position: relative; }
.srch input { width: 200px; height: 38px; border: 1px solid var(--ailo-line); background: var(--d30-paper); border-radius: 19px; padding: 0 14px 0 36px; font-size: 13px; color: var(--ailo-fg); transition: width .3s var(--ailo-ease); }
.srch input:focus { width: 260px; outline: none; border-color: var(--ailo-fg); }
.srch i { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--ailo-muted); font-size: 12.5px; }
.ibtn { position: relative; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--ailo-line); background: var(--d30-paper); display: grid; place-items: center; color: var(--ailo-fg); flex: none; }
.ibtn:hover { border-color: var(--ailo-fg); }
.ibtn .pip { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--d30-rose); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center; border: 2px solid var(--ailo-bg); box-sizing: content-box; }
.noti { position: relative; }
.noti__panel { position: absolute; right: 0; top: calc(100% + 12px); width: 340px; max-width: calc(100vw - 32px); background: var(--d30-paper); border: 1px solid var(--ailo-line); box-shadow: 0 24px 50px rgba(42,36,38,.14); z-index: 140; }
.noti__panel[hidden] { display: none; }
.noti__head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 18px 10px; }
.noti__head strong { font-family: var(--d30-serif); font-size: 16px; font-weight: 600; }
.noti__head button { border: 0; background: none; font-size: 12px; color: var(--ailo-muted); text-decoration: underline; text-underline-offset: 3px; }
.noti__list li { padding: 12px 18px; border-top: 1px solid var(--d30-hair); font-size: 13px; line-height: 1.5; }
.noti__list em { font-style: normal; font-size: 11px; letter-spacing: .08em; color: var(--d30-rose); font-weight: 700; display: block; }
.noti__list time { display: block; font-size: 11.5px; color: var(--ailo-muted); }
.me { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.me img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--d30-blush); }
.me span { line-height: 1.25; font-size: 13px; }
.me span small { display: block; font-size: 11px; color: var(--ailo-muted); }

/* 모바일 드로어 */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 340px); z-index: 130; background: var(--d30-paper);
  transform: translateX(100%); visibility: hidden; transition: transform .35s var(--ailo-ease), visibility .35s;
  display: flex; flex-direction: column; box-shadow: -20px 0 50px rgba(42,36,38,.18);
}
html.nav-open .drawer { transform: none; visibility: visible; transition: transform .35s var(--ailo-ease), visibility 0s; } /* 열 때 visibility 즉시 → 곧바로 포커스 가능 */
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--ailo-line); }
.drawer__close { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--ailo-line); background: transparent; }
.drawer nav { padding: 10px 20px; flex: 1; overflow-y: auto; }
.drawer nav a { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--d30-hair); font-family: var(--d30-serif); font-size: 17px; }
.drawer nav a[aria-current="page"] { color: var(--d30-rose); }
.drawer nav a small { font-family: var(--ailo-font); font-size: 12px; color: var(--d30-rose); font-weight: 700; }
.drawer__me { padding: 18px 20px; border-top: 1px solid var(--ailo-line); }
.drawer-overlay { position: fixed; inset: 0; z-index: 125; background: rgba(42,36,38,.35); opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; }
html.nav-open .drawer-overlay { opacity: 1; visibility: visible; }

/* ===== 인사 + 기간 ===== */
.intro { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 32px; padding: clamp(28px, 4vw, 52px) 0 clamp(20px, 2.6vw, 32px); }
.eyebrow { font-family: var(--d30-latin); font-style: italic; font-size: 16px; color: var(--d30-rose); letter-spacing: .04em; }
.intro h1 { font-family: var(--d30-serif); font-weight: 500; font-size: clamp(24px, 3vw, 38px); line-height: 1.3; letter-spacing: -.03em; margin-top: 6px; }
.intro h1 b { font-weight: 600; }
.crumb { display: flex; gap: 8px; font-size: 12px; color: var(--ailo-muted); margin-bottom: 4px; }
.crumb li + li::before { content: "—"; margin-right: 8px; }
.periods { display: flex; gap: 22px; border-bottom: 1px solid var(--ailo-line); }
.periods button { border: 0; background: none; padding: 0 0 10px; font-size: 14px; color: var(--ailo-muted); position: relative; white-space: nowrap; }
.periods button:hover { color: var(--ailo-fg); }
.periods button[aria-pressed="true"] { color: var(--ailo-fg); font-weight: 700; }
.periods button[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--d30-rose); }

/* ===== KPI ===== */
.kpi-row { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); border-top: 1px solid var(--ailo-fg); border-bottom: 1px solid var(--ailo-line); }
.kpi { padding: 24px 24px 22px; border-left: 1px solid var(--ailo-line); min-width: 0; display: flex; flex-direction: column; }
.kpi:first-child { border-left: 0; padding-left: 0; }
.kpi__l { font-size: 12.5px; color: var(--ailo-muted); letter-spacing: .02em; }
.kpi__v { font-size: clamp(24px, 2.2vw, 30px); font-weight: 600; letter-spacing: -.03em; margin: 8px 0 6px; line-height: 1.1; white-space: nowrap; }
.kpi__v small { font-size: .5em; font-weight: 500; color: var(--ailo-muted); margin-left: 2px; letter-spacing: 0; }
.kpi--hero .kpi__v { font-size: clamp(44px, 4.6vw, 64px); font-weight: 600; letter-spacing: -.045em; }
.kpi__f { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.dl { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.dl.g { color: var(--d30-good); } .dl.b { color: var(--d30-bad); }
.dl em { font-style: normal; color: var(--ailo-muted); font-weight: 400; margin-left: 4px; }
.spark { width: 90px; height: 28px; flex: none; overflow: visible; margin-right: 6px; }
.kpi--hero .spark { width: 150px; height: 40px; }

/* ===== 섹션 공통 ===== */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 clamp(24px, 3vw, 48px); }
.blk { padding: clamp(28px, 3.4vw, 44px) 0; border-bottom: 1px solid var(--ailo-line); min-width: 0; }
.blk__h { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.blk__h h2 { font-family: var(--d30-serif); font-weight: 500; font-size: clamp(19px, 1.7vw, 23px); letter-spacing: -.03em; }
.blk__h p { font-size: 12.5px; color: var(--ailo-muted); margin-top: 4px; }
.c-8 { grid-column: span 8; } .c-4 { grid-column: span 4; } .c-7 { grid-column: span 7; } .c-5 { grid-column: span 5; } .c-12 { grid-column: span 12; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ailo-muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend i { width: 18px; height: 2px; display: inline-block; border-radius: 1px; }
.legend i.sq { width: 10px; height: 10px; border-radius: 2px; }
.chart-box { position: relative; height: 300px; }

/* 카테고리 구성(톨 세그먼트 바) */
.mix__total { font-size: 12.5px; color: var(--ailo-muted); }
.mix__bar { display: flex; gap: 2px; height: 28px; margin: 14px 0 18px; }
.mix__bar div { border-radius: 4px; display: flex; align-items: center; padding: 0 6px 0 8px; font-size: 11.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; min-width: 0; transition: flex .4s var(--ailo-ease); }
.mix__list li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--d30-hair); font-size: 13.5px; }
.mix__list i { width: 10px; height: 10px; border-radius: 2px; }
.mix__list b { font-weight: 600; font-variant-numeric: tabular-nums; }
.mix__list span.m { color: var(--ailo-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }

/* 리뷰 감성 */
.senti__score { display: flex; align-items: baseline; gap: 12px; }
.senti__score strong { font-size: 44px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.senti__score span { color: var(--ailo-muted); font-size: 13px; }
.stars { color: var(--d30-rose); font-size: 13px; letter-spacing: 2px; }
.senti__bar { display: flex; gap: 2px; height: 28px; margin: 18px 0 8px; }
.senti__bar div { border-radius: 4px; display: flex; align-items: center; padding: 0 6px 0 8px; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; min-width: 0; transition: flex .4s var(--ailo-ease); }
.kw { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }
.kw h3 { font-size: 12px; font-weight: 600; color: var(--ailo-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kw ul { display: flex; flex-wrap: wrap; gap: 6px; }
.kw li { font-size: 12.5px; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--ailo-line); background: var(--d30-paper); }
.kw li b { font-weight: 600; margin-left: 4px; color: var(--ailo-muted); font-size: 11.5px; }
.quote { margin-top: 20px; padding: 16px 18px; background: var(--d30-paper); border-left: 2px solid var(--d30-rose); font-family: var(--d30-serif); font-size: 14px; line-height: 1.7; }
.quote cite { display: block; font-family: var(--ailo-font); font-style: normal; font-size: 11.5px; color: var(--ailo-muted); margin-top: 6px; }
.rate-box { position: relative; height: 150px; margin-top: 18px; }

/* 캠페인 */
.camps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.camp { background: var(--d30-paper); border: 1px solid var(--d30-hair); padding: 18px; min-width: 0; }
.camp__top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ini { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--d30-serif); font-weight: 600; font-size: 16px; flex: none; }
.camp__top strong { display: block; font-size: 13.5px; line-height: 1.3; }
.camp__top span { font-size: 11.5px; color: var(--ailo-muted); }
.camp h3 { font-family: var(--d30-serif); font-size: 15px; font-weight: 500; line-height: 1.4; margin-bottom: 12px; }
.camp dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; }
.camp dt { font-size: 11px; color: var(--ailo-muted); font-weight: 400; }
.camp dd { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.camp__st { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .02em; margin-top: 12px; }
.camp__st.on { color: var(--d30-good); }
.camp__st.end { color: var(--ailo-muted); }
.roas-box { position: relative; height: 230px; }

/* 테이블 */
.tbl-search { position: relative; }
.tbl-search input { height: 38px; width: 240px; max-width: 100%; border: 0; border-bottom: 1px solid var(--ailo-fg); background: transparent; padding: 0 4px 0 26px; font-size: 13.5px; color: var(--ailo-fg); }
.tbl-search input:focus { outline: none; border-bottom-width: 2px; }
.tbl-search i { position: absolute; left: 2px; top: 50%; translate: 0 -50%; font-size: 12.5px; color: var(--ailo-muted); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 13.5px; }
.tbl th { font-weight: 500; font-size: 12px; color: var(--ailo-muted); text-align: left; padding: 0 12px 12px; border-bottom: 1px solid var(--ailo-fg); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { padding-left: 0; }
.tbl th button { border: 0; background: none; padding: 0; color: inherit; font-weight: inherit; display: inline-flex; align-items: center; gap: 6px; }
.tbl th button i { font-size: 9.5px; opacity: .45; }
.tbl th[aria-sort] button { color: var(--ailo-fg); font-weight: 700; }
.tbl th[aria-sort] button i { opacity: 1; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl th.num button { flex-direction: row-reverse; }
.tbl td { padding: 14px 12px; border-bottom: 1px solid var(--d30-hair); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl tbody tr:hover td { background: rgba(255,255,255,.45); }
.rank { font-family: var(--d30-latin); font-size: 20px; font-style: italic; color: var(--ailo-muted); width: 28px; display: inline-block; }
.pd { display: flex; align-items: center; gap: 14px; }
.pd img { width: 44px; height: 54px; object-fit: cover; flex: none; background: var(--d30-blush); }
.pd strong { display: block; font-weight: 600; }
.pd span { font-size: 12px; color: var(--ailo-muted); }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.st i { font-size: 11px; }
.st--on { color: var(--d30-good); }
.st--low { color: var(--d30-warn); }
.st--out { color: var(--d30-bad); }
.st--pre { color: var(--d30-s2); }
.tbl-empty td { text-align: center; color: var(--ailo-muted); padding: 32px; }
.pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; font-size: 12.5px; color: var(--ailo-muted); }
.pager__btns { display: flex; gap: 2px; }
.pager__btns button { min-width: 34px; height: 34px; border: 0; background: transparent; border-radius: 50%; font-size: 13px; color: var(--ailo-fg); }
.pager__btns button:hover:not(:disabled) { background: var(--d30-blush); }
.pager__btns button[aria-current="page"] { background: var(--ailo-fg); color: #fff; }
.pager__btns button:disabled { opacity: .3; cursor: default; }

/* 운영 노트(활동) */
.notes li { padding: 14px 0; border-top: 1px solid var(--d30-hair); display: grid; grid-template-columns: 52px 1fr; gap: 10px; }
.notes li:first-child { border-top: 0; padding-top: 0; }
.notes time { font-size: 12px; color: var(--ailo-muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.notes p { font-size: 13.5px; line-height: 1.55; }
.notes p em { font-style: normal; display: block; font-size: 10.5px; letter-spacing: .1em; font-weight: 700; color: var(--d30-rose); text-transform: uppercase; margin-bottom: 1px; }
.notes p span { color: var(--ailo-muted); font-size: 12.5px; }

.btn-ink { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 18px; background: var(--ailo-fg); color: #fff; border: 0; border-radius: 19px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.btn-ink:hover { background: #000; color: #fff; }

.foot { padding: 28px 0 36px; font-size: 12px; color: var(--ailo-muted); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
.foot a:hover { color: var(--ailo-fg); }

/* ===== 반응형 ===== */
@media (max-width: 1279.98px) {
  .srch { display: none; }
  .me span { display: none; }
  .gnb { gap: 14px; }
  .gnb a { font-size: 13.5px; }
}
@media (max-width: 1199.98px) {
  .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi--hero { grid-column: 1 / -1; border-bottom: 1px solid var(--ailo-line); flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 6px 24px; padding-left: 0; }
  .kpi--hero .kpi__f { margin-top: 0; flex: 1; }
  .kpi:nth-child(2) { border-left: 0; padding-left: 0; }
  .c-sales, .c-mix, .c-senti, .c-camp, .c-table, .c-notes { grid-column: span 12; }
  .mix-in { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; align-items: start; }
}
@media (max-width: 991.98px) {
  .gnb { display: none; }
  .hd__in { height: 62px; }
  .ailo-burger { order: 9; margin-right: -8px; }
  .camps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 18px 16px; }
  .kpi:nth-child(2), .kpi:nth-child(4) { border-left: 0; padding-left: 0; }
  .kpi:nth-child(2), .kpi:nth-child(3) { border-bottom: 1px solid var(--ailo-line); }
  .mix-in { grid-template-columns: 1fr; }
  .camps { grid-template-columns: 1fr; }
  .tbl-search, .tbl-search input { width: 100%; }
  .blk__h > div:last-child { width: 100%; }
}
@media (max-width: 575.98px) {
  .kpi__f { flex-direction: column; align-items: flex-start; gap: 6px; }
  .spark { width: 100%; }
  .kpi--hero .spark { width: 100%; }
  .dl em { display: block; margin-left: 0; }
  .periods { width: 100%; justify-content: space-between; gap: 8px; }
  .chart-box { height: 250px; }
  .kw { grid-template-columns: 1fr; }
  .brand small { display: none; }
  .intro h1 br { display: none; }
}
