/* ── Dashboard Screen · P2 · 2026-04-22 ─────────────────────────
   설정 시트에서 진입하는 대시보드 오버레이 전용 스타일.
   토큰: css/tokens.css · 컴포넌트: css/components.css */

/* ── 헤더 ──────────────────────────────────────────────────────── */
.db-hdr {
  padding: max(52px, calc(env(safe-area-inset-top) + 14px)) 20px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.db-back {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: none;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .12s;
}

.db-back:active {
  opacity: .6;
}

.db-hdr h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

/* ── 바디 스크롤 ────────────────────────────────────────────────── */
.db-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px max(24px, calc(env(safe-area-inset-bottom) + 16px));
}

.db-body::-webkit-scrollbar {
  display: none;
}

/* ── Hero 카드 ────────────────────────────────────────────────── */
.db-hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: #fff;
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-brand);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.db-hero::after {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .10);
  pointer-events: none;
}

.db-hero__lbl {
  font-size: 12px;
  opacity: .85;
  display: flex;
  align-items: center;
  gap: 6px;
}

.db-hero__val {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.6px;
  margin: 4px 0 2px;
}

.db-hero__delta {
  font-size: 13px;
  opacity: .95;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.db-hero__row {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .2);
}

.db-hero__mini {
  flex: 1;
}

.db-hero__mini-lbl {
  font-size: 11px;
  opacity: .80;
}

.db-hero__mini-val {
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

/* ── 섹션 헤더 ──────────────────────────────────────────────────── */
.db-sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 10px;
}

.db-sec h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.db-sec__hint {
  font-size: 12px;
  color: var(--text-subtle);
}

/* ── 주요 지표 2×2 ─────────────────────────────────────────────── */
.db-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.db-wid {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  transition: transform .15s;
  color: var(--text);
  font-family: inherit;
}

.db-wid:active {
  transform: scale(.985);
}

.db-wid__top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.db-wid__ic {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--brand-bg);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.db-wid__ttl {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.db-wid__val {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.3px;
  color: var(--text);
}

.db-wid__sub {
  font-size: 11px;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 3px;
}

.db-wid__sub--up {
  color: var(--ok);
}

.db-wid__sub--down {
  color: var(--danger);
}

/* ── 바로가기 4버튼 ────────────────────────────────────────────── */
.db-qrow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}

.db-qa {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--text);
  transition: transform .12s;
  font-family: inherit;
}

.db-qa:active {
  transform: scale(.96);
}

.db-qa__ic {
  color: var(--brand);
}

.db-qa__t {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

/* ── 데이터 & 인사이트 리스트 ────────────────────────────────────── */
.db-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.db-menu-it {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  width: 100%;
  text-align: left;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: background .12s;
  font-family: inherit;
}

.db-menu-it:last-child {
  border-bottom: none;
}

.db-menu-it:active {
  background: var(--surface-2);
}

.db-menu__ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.db-menu__ic--pink {
  background: var(--brand-bg);
  color: var(--brand);
}

.db-menu__tx {
  flex: 1;
  min-width: 0;
}

.db-menu__t {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.db-menu__s {
  font-size: 12px;
  color: var(--text-subtle);
  margin: 2px 0 0;
}

.db-menu__arr {
  color: var(--text-subtle);
}

.db-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  padding: 3px 7px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  flex-shrink: 0;
}

.db-badge--ok {
  background: var(--ok);
}

.db-badge--warn {
  background: var(--warn);
}
