.dash-page {
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(16, 22, 19, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 22, 19, .03) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

.dash-top {
  position: sticky; top: 0; z-index: 60;
  background: var(--ink);
  color: rgba(247, 246, 240, .7);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.dash-top .inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; height: 68px;
}
.dash-top .wrap, .dash-page .footer .wrap { max-width: 1220px; }
.dash-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dash-top .logo { color: #f7f6f0; }
.dash-top .logo:hover { color: #fff; }
.dash-top .logo-mark { background: var(--gold); color: var(--ink); }
.dash-div { width: 1px; height: 22px; flex: none; background: rgba(255, 255, 255, .16); }
.dash-title h1 { color: #f7f6f0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.chip {
  display: inline-flex; align-items: center;
  padding: 5px 9px;
  border: 1px solid rgba(243, 203, 116, .38); border-radius: 6px;
  background: rgba(243, 203, 116, .12); color: var(--gold);
  font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  white-space: nowrap;
}
.dash-top .btn-outline {
  padding: 9px 16px; border-radius: 8px; border-color: rgba(255, 255, 255, .22);
  color: #f7f6f0; font-size: 13px;
}
.dash-top .btn-outline:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .42); color: #fff; }

.dash-wrap { max-width: 1220px; margin: 0 auto; padding: 28px 28px 64px; }
.notice {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 20px; padding: 11px 14px;
  border: 1px solid rgba(31, 122, 99, .18); border-left: 3px solid var(--pine); border-radius: 6px;
  background: rgba(226, 242, 236, .6); color: var(--ink-2);
  font-size: 12.5px; font-weight: 600;
}
.notice svg { flex: none; color: var(--pine); }

.dash-grid { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 24px; align-items: start; }

.side {
  position: sticky; top: 88px;
  padding: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 22, 19, .04);
}
.side-label { padding: 4px 10px 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.side button {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 12px;
  border: 0; border-radius: 8px; background: none;
  color: var(--ink-2); font-family: inherit; font-size: 13.5px; font-weight: 600; text-align: left;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease;
}
.side button:hover { background: var(--paper); color: var(--ink); }
.side button.on { background: var(--ink); color: #fff; }
.side button.on::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px;
  border-radius: 0 2px 2px 0; background: var(--gold);
}
.side button svg { flex: none; width: 16px; height: 16px; opacity: .7; }
.side button.on svg { opacity: 1; color: var(--gold); }
.side-note { margin-top: 12px; padding: 12px 10px 4px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.55; }

.views { min-width: 0; }
.view { display: grid; gap: 20px; animation: panelIn .3s ease both; }
.ov-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ov-head h2 { font-size: 20px; letter-spacing: -0.025em; }
.ov-head p { margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--muted);
  font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap;
}

.stat-band {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--line); overflow: hidden;
}
.stat-band.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { min-width: 0; padding: 18px 18px 16px; background: var(--surface); }
.stat:hover { transform: none; box-shadow: none; }
.stat .k { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.stat .v {
  display: block; margin-top: 9px;
  color: var(--ink); font-size: clamp(22px, 2.1vw, 28px); font-weight: 800;
  letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums;
}
.stat .s { display: block; margin-top: 8px; color: var(--muted); font-size: 11.5px; }
.stat.is-accent { background: var(--ink); }
.stat.is-accent .k, .stat.is-accent .s { color: rgba(247, 246, 240, .5); }
.stat.is-accent .v { color: #fff; }

.dash-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.card {
  display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 22, 19, .04);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 58px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 14.5px; letter-spacing: -0.015em; }
.card-head .sub { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.card-foot { margin-top: auto; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }

.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 460px; }
.table-scroll.is-wide table { min-width: 680px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 18px; text-align: left; white-space: nowrap; font-size: 13px; border-bottom: 1px solid var(--line); }
th { background: #fbfaf6; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
th.num, td.num { text-align: right; }
td.num { font-variant-numeric: tabular-nums; }
tbody tr { transition: background-color .14s ease; }
tbody tr:hover { background: rgba(31, 122, 99, .032); }
tbody tr:last-child td { border-bottom: 0; }
.name-cell { color: var(--ink); font-weight: 700; }
.chan { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.chan i { flex: none; width: 7px; height: 7px; border-radius: 2px; }
.chan.email i { background: var(--pine); }
.chan.sms i { background: var(--gold-deep); }
.no-rows { padding: 26px 18px; text-align: center; color: var(--muted); font-size: 13px; }

.chart-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 14px; }
.chart-value { color: var(--ink); font-size: 24px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.chart-value span { margin-left: 7px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.chart {
  display: flex; align-items: flex-end; gap: 6px;
  flex: 1; min-height: 132px; margin-top: 14px; padding-bottom: 1px;
  border-bottom: 1px solid var(--line);
}
.chart span {
  flex: 1; height: var(--h); min-height: 5px; border-radius: 3px 3px 0 0;
  background: #d9ece5; transform-origin: bottom;
  animation: barGrow .6s cubic-bezier(.2, .8, .2, 1) both;
}
.chart span:nth-child(3n) { background: #a9d3c6; }
.chart span.is-peak { background: var(--gold); }
.chart span:last-child { background: var(--pine); }
.chart-axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 10px; }

.filters { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf6; }
.filter {
  padding: 6px 12px; border: 0; border-radius: 6px; background: none;
  color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.filter:hover { color: var(--ink); }
.filter.on { background: var(--ink); color: #fff; }

.msg-split { display: grid; grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); align-items: stretch; }
.msg-preview-side { padding: 18px; background: #fbfaf6; border-right: 1px solid var(--line); }
.msg-detail-side { padding-bottom: 6px; }
.detail-title { padding: 14px 18px 6px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.toggle-2 { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #fbfaf6; }
.toggle-2 button {
  padding: 6px 14px; border: 0; border-radius: 6px; background: none;
  color: var(--muted); font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.toggle-2 button.on { background: var(--ink); color: #fff; }

.msg-pane { min-width: 0; }
.preview-msg { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.preview-msg .top { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.preview-msg .top .subject { color: var(--ink); font-size: 14.5px; font-weight: 700; }
.preview-msg .top .from { margin-top: 4px; color: var(--muted); font-size: 12px; }
.preview-msg .content { padding: 20px 16px; }
.preview-msg .hero {
  display: grid; place-content: center; height: 138px;
  text-align: center; color: #fff;
  background:
    radial-gradient(220px 120px at 86% 0%, rgba(243, 203, 116, .28), transparent 70%),
    linear-gradient(135deg, #0e3a2f, var(--pine));
}
.preview-msg .hero .big { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.preview-msg .hero .small { margin-top: 6px; color: rgba(255, 255, 255, .78); font-size: 12px; }
.preview-msg .lines { display: grid; gap: 8px; margin-top: 16px; }
.preview-msg .lines span { height: 8px; border-radius: 2px; background: var(--paper-deep); }
.preview-msg .lines span:nth-child(2) { width: 80%; }
.preview-msg .lines span:nth-child(3) { width: 62%; }
.preview-msg .cta-line {
  display: inline-block; margin-top: 16px; padding: 9px 16px;
  border-radius: 6px; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 700;
}
.fineprint { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.sms-preview { padding: 26px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.sms-preview .bubble {
  max-width: 340px; margin: 0 auto; padding: 13px 15px;
  border-radius: 10px 10px 10px 3px;
  background: var(--pine); color: #fff;
  font-size: 13.5px; line-height: 1.55;
}
.sms-preview .meta { margin-top: 12px; text-align: center; color: var(--muted); font-size: 11px; }

.detail-list { display: grid; }
.detail-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--muted); }
.detail-row dd { color: var(--ink); font-weight: 700; text-align: right; }
.status { display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-deep); }

@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; gap: 18px; }
  .side { position: static; display: flex; gap: 6px; padding: 8px; overflow-x: auto; }
  .side-label, .side-note { display: none; }
  .side button { flex: 1; width: auto; justify-content: center; white-space: nowrap; }
  .side button.on::before { left: 12px; right: 12px; top: auto; bottom: 5px; width: auto; height: 2px; border-radius: 2px; }
  .dash-cols { grid-template-columns: 1fr; }
  .stat .v { font-size: 26px; }
}

@media (max-width: 900px) {
  .msg-split { grid-template-columns: 1fr; }
  .msg-preview-side { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 780px) {
  .dash-wrap { padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 720px) {
  .dash-top .inner { height: 62px; }
  .dash-title h1, .dash-div { display: none; }
  .dash-wrap { padding-top: 20px; padding-bottom: 52px; }
  .stat-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-band.three { grid-template-columns: 1fr; }
  .stat { padding: 16px 15px 15px; }
  .stat .v { font-size: 23px; }
  .ov-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card-head { flex-wrap: wrap; }
  .table-scroll table { min-width: 520px; }
  .table-scroll.is-wide table { min-width: 660px; }
  th, td { padding: 11px 16px; }
  .chart { min-height: 118px; }
}

@media (max-width: 620px) {
  .dash-wrap { padding-left: 18px; padding-right: 18px; }
  .side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .side button { justify-content: center; padding: 9px 8px; font-size: 12.5px; }
}

@media (max-width: 460px) {
  .dash-wrap { padding: 16px 18px 44px; }
  .dash-title .chip { display: none; }
  .side { display: flex; flex-wrap: wrap; }
  .side button { flex: 1 1 100%; justify-content: flex-start; }
  .side button.on::before { left: 0; right: auto; top: 9px; bottom: 9px; width: 2px; height: auto; }
  .stat-band { grid-template-columns: 1fr; }
  .stat .v { font-size: 24px; }
  .notice { font-size: 12px; }
  .dash-top .btn-outline { padding: 8px 12px; font-size: 12px; }
}
