:root {
  --bg: #f5f7fb; --surface: #ffffff; --surface-soft: #f8faff; --text: #1c2440;
  --muted: #8490a8; --border: #e9edf5; --accent: #6258e8; --accent-dark: #5046d4;
  --accent-soft: #eeedff; --green: #25a879; --shadow: 0 8px 28px rgba(37, 49, 91, .045);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 14px; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.sidebar { width: 244px; background: #fff; border-right: 1px solid var(--border); position: fixed; inset: 0 auto 0 0; padding: 30px 18px 22px; display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #202746; font-family: Manrope, sans-serif; font-size: 17px; font-weight: 800; letter-spacing: -.65px; padding: 0 8px; white-space: nowrap; }
.brand-light { font-weight: 500; color: #8790a8; }
.brand-mark { width: 31px; height: 31px; display: inline-flex; align-items: flex-end; gap: 3px; justify-content: center; padding: 6px; background: var(--accent); border-radius: 10px; flex-shrink: 0; }
.brand-mark span { display: block; width: 4px; border-radius: 4px; background: #fff; }
.brand-mark span:nth-child(1) { height: 8px; opacity: .65; } .brand-mark span:nth-child(2) { height: 13px; opacity: .85; } .brand-mark span:nth-child(3) { height: 18px; }
.workspace-label { margin: 48px 12px 14px; color: #a2abc0; font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.nav { display: grid; gap: 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #7c879e; padding: 12px 13px; border-radius: 10px; font-weight: 600; transition: .2s; }
.nav-link:hover { background: #f7f7ff; color: var(--accent); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-icon { width: 18px; text-align: center; font-size: 18px; font-weight: 500; }
.sidebar-bottom { margin-top: auto; }
.status-card { display: flex; align-items: flex-start; gap: 10px; background: #f8f9fd; border: 1px solid #eef0f7; border-radius: 12px; padding: 13px 11px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #28bf89; box-shadow: 0 0 0 3px rgba(40,191,137,.12); flex-shrink: 0; }
.status-card .status-dot { margin-top: 5px; }
.status-card strong, .status-card small { display: block; }
.status-card strong { font-size: 11px; font-weight: 700; }
.status-card small { font-size: 10px; color: var(--muted); margin-top: 5px; }
.sidebar-note { color: #a1a9bb; font-size: 10px; text-align: center; padding-top: 18px; }
.main-content { margin-left: 244px; min-height: 100vh; }
.topbar { height: 76px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 42px; }
.breadcrumb { display: flex; gap: 10px; align-items: center; color: #9aa4b8; font-size: 12px; }
.breadcrumb strong { color: #303953; font-weight: 600; }
.crumb-sep { color: #c4cad7; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.live-label { display: flex; align-items: center; gap: 8px; color: #77839a; font-size: 11px; font-weight: 600; }
.icon-button { border: 1px solid var(--border); width: 34px; height: 34px; border-radius: 10px; background: white; color: #6f7890; font-size: 17px; }
.avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: #eae8ff; color: var(--accent); font-weight: 800; font-size: 11px; }
.mobile-brand, .menu-button { display: none; }
.page { max-width: 1530px; padding: 37px 42px 24px; margin: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.eyebrow, .section-kicker { font-size: 9px; font-weight: 800; color: var(--accent); letter-spacing: 1.55px; }
h1, h2, p { margin-top: 0; }
h1 { font-family: Manrope, sans-serif; font-size: clamp(25px, 2.4vw, 34px); letter-spacing: -1.3px; line-height: 1.25; margin: 8px 0 7px; font-weight: 800; }
.heading-period { color: var(--accent); }
.subheading { color: var(--muted); margin: 0; font-size: 13px; }
.heading-actions { display: flex; align-items: center; gap: 10px; }
.date-chip, .secondary-button { display: flex; align-items: center; gap: 9px; height: 39px; padding: 0 13px; border: 1px solid var(--border); background: var(--surface); border-radius: 9px; color: #69748d; font-size: 11px; font-weight: 600; white-space: nowrap; }
.date-chip span:first-child { font-size: 15px; color: var(--accent); }
.primary-button { display: flex; align-items: center; gap: 8px; height: 39px; padding: 0 15px; background: var(--accent); border: 1px solid var(--accent); border-radius: 9px; color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 5px 12px rgba(98,88,232,.18); transition: .2s; white-space: nowrap; }
.primary-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.refresh-symbol { font-size: 17px; line-height: 1; }
.primary-button.loading .refresh-symbol { display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { background: #fff5f2; border: 1px solid #ffd8cf; color: #a74430; border-radius: 10px; padding: 12px 15px; margin-bottom: 18px; font-size: 12px; line-height: 1.6; }
.alert[hidden] { display: none; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 19px; }
.stat-card { min-width: 0; position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 20px 17px; box-shadow: var(--shadow); }
.stat-top, .stat-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 11px; color: #7f8aa2; font-weight: 600; }
.stat-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; font-weight: 800; font-size: 15px; }
.money-icon { color: #fff; background: rgba(255,255,255,.18); }
.view-icon { background: #edecff; color: #655be9; } .click-icon { background: #e5f8f0; color: #22a778; } .ctr-icon { background: #fff2df; color: #d99428; }
.stat-value { font-family: Manrope, sans-serif; font-size: clamp(25px, 2.4vw, 32px); letter-spacing: -1.2px; font-weight: 800; margin: 17px 0 16px; line-height: 1.15; white-space: nowrap; }
.stat-bottom { border-top: 1px solid var(--border); padding-top: 13px; }
.stat-caption { color: #9aa4b7; font-size: 10px; }
.mini-tag { color: #d9d6ff; font-size: 8px; letter-spacing: 1px; font-weight: 800; }
.metric-mark { color: #20a777; font-size: 15px; font-weight: 700; } .metric-mark.muted { color: #c2c8d4; }
.revenue-card { color: white; background: linear-gradient(135deg, #6d62f1 0%, #5348d6 100%); border-color: transparent; }
.revenue-card .stat-label, .revenue-card .stat-caption { color: rgba(255,255,255,.72); }
.revenue-card .stat-bottom { border-color: rgba(255,255,255,.19); }
.card-decoration { position: absolute; width: 120px; height: 120px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; right: -49px; top: 58px; pointer-events: none; }
.card-decoration::after { content: ""; position: absolute; inset: 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, 1fr); gap: 18px; margin-bottom: 19px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); min-width: 0; }
.chart-panel, .breakdown-panel { padding: 23px 23px 19px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
h2 { font-family: Manrope, sans-serif; font-size: 17px; letter-spacing: -.45px; font-weight: 800; margin: 7px 0 5px; }
.panel-subtitle { margin: 0; color: #97a1b5; font-size: 11px; }
.chart-legend { display: flex; align-items: center; gap: 7px; color: #76829a; font-size: 10px; padding-top: 7px; white-space: nowrap; }
.legend-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.legend-unit { color: #aab2c1; }
.chart-summary { display: flex; align-items: baseline; gap: 9px; margin-top: 25px; }
.chart-summary strong { font-family: Manrope, sans-serif; font-size: 25px; letter-spacing: -.7px; }
.chart-summary span { color: #9aa4b7; font-size: 10px; }
.chart-wrap { height: 185px; width: 100%; position: relative; margin-top: 8px; }
#revenueChart { display: block; width: 100%; height: 100%; }
.chart-foot { display: flex; justify-content: space-between; color: #a4adbd; font-size: 9px; padding-top: 5px; }
.panel-badge { background: #f2f1ff; color: var(--accent); border-radius: 6px; padding: 6px 8px; font-size: 8px; font-weight: 800; letter-spacing: .8px; white-space: nowrap; }
.metric-list { margin-top: 27px; }
.metric-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f0f2f7; }
.metric-label { display: flex; align-items: center; gap: 10px; color: #7b879e; font-size: 11px; }
.metric-row strong { font-family: Manrope, sans-serif; font-size: 12px; font-weight: 800; }
.metric-bullet { width: 8px; height: 8px; border-radius: 3px; }
.impressions-bullet { background: #756bf0; } .clicks-bullet { background: #2db78a; } .ctr-bullet { background: #efb34c; } .cpm-bullet { background: #75a8f7; }
.insight-box { display: flex; gap: 10px; padding: 13px 12px; background: #f8f8ff; border: 1px solid #f0efff; border-radius: 10px; margin-top: 18px; }
.insight-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; color: var(--accent); background: #e9e7ff; flex-shrink: 0; }
.insight-box strong { font-size: 10px; } .insight-box p { color: #8b96ab; font-size: 10px; line-height: 1.55; margin: 4px 0 0; }
.table-panel { overflow: hidden; }
.table-heading { padding: 22px 23px 19px; align-items: center; }
.table-actions { display: flex; gap: 9px; align-items: center; }
.search-box { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; color: #98a2b5; }
.search-box span { font-size: 18px; }
.search-box input { border: 0; outline: 0; width: 120px; color: var(--text); background: transparent; font-size: 10px; }
.search-box input::placeholder { color: #a2adbf; }
.secondary-button { height: 36px; font-size: 10px; }
.secondary-button:hover, .icon-button:hover { background: var(--surface-soft); color: var(--accent); }
.secondary-button span { color: var(--accent); font-size: 15px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
thead { background: #fafbfe; }
th { padding: 13px 23px; color: #a0aabc; font-size: 8px; letter-spacing: .8px; text-align: left; font-weight: 800; }
td { padding: 15px 23px; color: #68758e; font-size: 11px; border-bottom: 1px solid #f0f2f7; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfbff; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
td:first-child { color: #38425c; font-weight: 700; }
.revenue-cell { color: #28a47b; font-weight: 800; }
.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 23px; border-top: 1px solid var(--border); color: #9ba5b7; font-size: 9px; }
.page-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 2px 0; color: #a0a9b9; font-size: 9px; }
.footer-separator { padding: 0 5px; }
.update-info { display: flex; align-items: center; gap: 8px; }
.update-info .status-dot { width: 6px; height: 6px; }
body.dark { --bg: #121625; --surface: #1a2032; --surface-soft: #222a40; --text: #edf0fb; --muted: #9ca8c1; --border: #2a3248; --shadow: 0 8px 28px rgba(0,0,0,.1); }
body.dark .sidebar, body.dark .topbar { background: #181e2e; }
body.dark .brand, body.dark .breadcrumb strong, body.dark td:first-child { color: #edf0fb; }
body.dark .nav-link.active { background: #2b2a50; }
body.dark .status-card, body.dark thead, body.dark .insight-box { background: #20273b; border-color: #30364b; }
body.dark .insight-box { background: #252641; }
body.dark .metric-row, body.dark td { border-color: #2a3248; }
body.dark tbody tr:hover { background: #20273b; }
body.dark .icon-button, body.dark .date-chip, body.dark .secondary-button { background: #1a2032; color: #c4cbe0; }
body.dark .panel-badge { background: #2b2a50; }
body.dark .search-box input { color: #edf0fb; }
body.dark .revenue-card { background: linear-gradient(135deg, #6d62f1 0%, #5348d6 100%); }
@media (min-width: 1600px) { .page { padding-top: 48px; } .stat-card { padding: 24px; } }
@media (max-width: 1200px) {
  .sidebar { width: 215px; } .main-content { margin-left: 215px; }
  .topbar { padding: 0 27px; } .page { padding: 30px 27px 22px; }
  .stats-grid { gap: 11px; } .stat-card { padding: 17px 15px; }
  .stat-caption { font-size: 9px; } .content-grid { grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); gap: 13px; }
  .chart-panel, .breakdown-panel { padding: 19px; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 15px 0 40px rgba(0,0,0,.08); }
  .sidebar.open { transform: translateX(0); } .main-content { margin-left: 0; }
  .menu-button { display: inline-grid; place-items: center; order: 0; border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 34px; height: 34px; border-radius: 9px; }
  .topbar { padding: 0 22px; gap: 13px; } .breadcrumb { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; margin-right: auto; font-family: Manrope, sans-serif; font-size: 13px; }
  .mobile-brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
  .topbar-actions { gap: 10px; } .live-label { display: none; }
  .page { padding: 28px 22px 22px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: 1fr; }
  .breakdown-panel .metric-list { margin-top: 17px; }
}
@media (max-width: 600px) {
  .topbar { height: 64px; padding: 0 14px; } .page { padding: 25px 14px 20px; }
  .page-heading { display: block; margin-bottom: 22px; }
  h1 { font-size: 27px; } .subheading { font-size: 12px; line-height: 1.6; }
  .heading-actions { margin-top: 19px; display: grid; grid-template-columns: 1fr auto; }
  .date-chip, .primary-button { justify-content: center; padding: 0 10px; }
  .stats-grid { gap: 10px; margin-bottom: 13px; }
  .stat-card { padding: 15px 13px 13px; border-radius: 12px; }
  .stat-label { font-size: 10px; } .stat-icon { width: 29px; height: 29px; border-radius: 8px; }
  .stat-value { font-size: 25px; margin: 14px 0; }
  .stat-caption { font-size: 9px; line-height: 1.4; }
  .mini-tag { display: none; }
  .content-grid { gap: 13px; margin-bottom: 13px; }
  .chart-panel, .breakdown-panel { padding: 17px 15px; }
  .panel-heading { gap: 8px; } h2 { font-size: 16px; }
  .chart-legend { font-size: 9px; gap: 5px; }
  .chart-summary { margin-top: 22px; } .chart-wrap { height: 165px; }
  .table-heading { display: block; padding: 19px 15px 15px; }
  .table-actions { margin-top: 17px; display: grid; grid-template-columns: minmax(0,1fr) auto; }
  .search-box { min-width: 0; } .search-box input { width: 100%; min-width: 0; }
  th { padding: 12px 15px; } td { padding: 14px 15px; }
  .table-footer { padding: 13px 15px; gap: 10px; }
  .table-footer span:last-child { text-align: right; }
  .page-footer { display: grid; gap: 12px; line-height: 1.5; }
  .update-info { align-items: flex-start; }
  .avatar { display: none; }
}
@media (max-width: 360px) {
  .mobile-brand strong { font-size: 11px; } .topbar-actions { gap: 5px; }
  .stats-grid { grid-template-columns: 1fr; } .stat-value { font-size: 28px; }
}

html {
  scroll-behavior: smooth;
}

#performance,
#daily {
  scroll-margin-top: 20px;
}
