:root {
  color-scheme: light;
  --ink: #202938;
  --muted: #7b8798;
  --line: #e8edf3;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --navy: #172338;
  --accent: #5367d9;
  --accent-soft: #eef0ff;
  font-family: "Manrope", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-size: 14px; line-height: 1.55; }
button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid #8ca0ff; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 8px 12px; transform: translateY(-160%); border-radius: 8px; background: var(--navy); color: white; }
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: 248px; flex-direction: column; padding: 28px 16px 18px; background: var(--navy); color: #d6deea; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 44px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #4a5c78; border-radius: 12px; background: #263650; color: #fff; font-size: 18px; font-weight: 700; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { color: #fff; font-size: 14px; font-weight: 700; }
.brand-copy span { color: #8290a7; font-size: 10px; letter-spacing: .16em; }
.nav-label { margin: 0 12px 10px; color: #8290a7; font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.primary-nav { display: grid; gap: 6px; }
.nav-link { display: flex; min-height: 44px; align-items: center; gap: 12px; padding: 0 12px; border-radius: 10px; color: #aeb9ca; text-decoration: none; transition: color 250ms cubic-bezier(.22,1,.36,1), background 250ms cubic-bezier(.22,1,.36,1); }
.nav-link:hover { background: #22324b; color: #fff; }
.nav-link.is-active { background: #2a3b58; color: #fff; box-shadow: inset 3px 0 #8d9bff; }
.nav-icon { width: 18px; color: #9caaca; font-size: 19px; text-align: center; }
.nav-link.is-active .nav-icon { color: #aab4ff; }
.nav-tag { margin-left: auto; border: 1px solid #4c5d78; border-radius: 5px; padding: 1px 6px; color: #aeb9ca; font-size: 10px; }
.sidebar-bottom { display: grid; gap: 20px; margin-top: auto; }
.connection-card { display: flex; gap: 10px; padding: 13px 12px; border: 1px solid #34445d; border-radius: 12px; background: #1d2b41; }
.connection-card div, .profile-copy { display: grid; gap: 2px; }
.connection-card strong { color: #e4eaf2; font-size: 12px; font-weight: 600; }
.connection-card span:last-child { color: #91a0b6; font-size: 11px; }
.connection-dot, .status-dot { width: 8px; height: 8px; flex: 0 0 auto; margin-top: 5px; border-radius: 50%; background: #e3a54b; }
.profile { display: flex; align-items: center; gap: 10px; padding: 14px 5px 0; border-top: 1px solid #34445d; }
.profile-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #dce5f7; color: #314568; font-weight: 700; }
.profile-copy strong { color: #e3e9f1; font-size: 12px; font-weight: 600; }
.profile-copy span { color: #8998ae; font-size: 11px; }
.profile-more { margin-left: auto; color: #8d9bb1; letter-spacing: 2px; }
.main-column { min-height: 100vh; margin-left: 248px; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; height: 68px; align-items: center; justify-content: space-between; padding: 0 40px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 94%); backdrop-filter: blur(12px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #8b96a5; font-size: 12px; }
.breadcrumb strong { color: #344053; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.updated-label { display: flex; align-items: center; gap: 7px; color: #7f8b9b; font-size: 11px; }
.updated-label .status-dot, .data-waiting .status-dot { width: 7px; height: 7px; margin: 0; }
.icon-button { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #8b96a5; }
.icon-button svg { width: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
main { width: min(100% - 80px, 1240px); margin: 0 auto; padding: 38px 0 28px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow, .section-kicker { margin: 0 0 7px; color: #929dad; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; color: #1f2a3b; font-size: 28px; font-weight: 700; letter-spacing: -.04em; line-height: 1.25; }
.page-description { margin: 0; color: #7c8898; font-size: 13px; }
.period-control { display: flex; min-height: 42px; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #e2e7ef; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgb(26 39 63 / 3%); }
.calendar-icon { color: #7e8aa0; font-size: 17px; }
.period-control strong { color: #354155; font-size: 12px; font-weight: 600; }
.period-caption { margin-left: 4px; padding: 2px 6px; border-radius: 5px; background: #f2f4f8; color: #8590a0; font-size: 10px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { min-height: 148px; padding: 19px 20px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 2px 5px rgb(26 39 63 / 2%); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: #657184; font-size: 12px; font-weight: 500; }
.metric-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; font-size: 16px; }
.metric-icon.indigo { background: #eff0ff; color: #6977d8; }
.metric-icon.blue { background: #eaf4ff; color: #538fcd; }
.metric-icon.teal { background: #e8f7f4; color: #40a291; }
.metric-icon.amber { background: #fff5e6; color: #d49a40; }
.metric-value { margin-top: 13px; color: #263349; font-size: 27px; font-weight: 700; letter-spacing: -.04em; line-height: 1.1; }
.metric-value small { margin-left: 2px; color: #8893a3; font-size: 14px; font-weight: 500; }
.metric-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; color: #98a2b1; font-size: 10px; }
.metric-placeholder { color: #a2acb9; }
.content-section { margin-top: 34px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-kicker { margin-bottom: 3px; font-size: 9px; }
h2 { margin: 0; color: #273247; font-size: 17px; font-weight: 700; letter-spacing: -.025em; }
.source-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border: 1px solid #e9edf3; border-radius: 999px; background: #fff; color: #738095; font-size: 10px; }
.source-dot { width: 7px; height: 7px; border-radius: 50%; }
.ga-dot { background: #e9a443; }
.chart-card { overflow: hidden; min-height: 270px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.chart-toolbar { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border-bottom: 1px solid #f0f2f6; }
.legend { display: flex; align-items: center; gap: 7px; color: #8691a1; font-size: 10px; }
.legend-mark { width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; }
.legend-mark:first-child { margin-left: 0; }
.users-mark { background: #6578db; }
.sessions-mark { background: #91a2ed; }
.chart-period { color: #a0a9b5; font-size: 10px; }
.chart-empty { display: grid; min-height: 220px; align-content: center; justify-items: center; padding: 24px; text-align: center; }
.empty-chart-icon { display: grid; width: 54px; height: 48px; place-items: center; margin-bottom: 13px; border-radius: 12px; background: #f4f6ff; }
.empty-chart-icon svg { width: 36px; fill: none; stroke: #8795de; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.chart-empty strong { color: #566276; font-size: 12px; font-weight: 600; }
.chart-empty > span { margin-top: 4px; color: #9ba5b2; font-size: 11px; }
.section-meta { color: #939eac; font-size: 11px; }
.social-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.social-card { min-height: 196px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 2px 5px rgb(26 39 63 / 2%); }
.social-card-top { display: flex; align-items: center; gap: 9px; }
.social-avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; font-size: 17px; font-weight: 700; }
.social-avatar.instagram { background: #fff0f2; color: #cf677f; }
.social-avatar.facebook { background: #edf3ff; color: #4a73c7; font-family: Arial, sans-serif; }
.account-label { color: #98a2b0; font-size: 10px; }
.more-menu { margin-left: auto; color: #a8b0bc; letter-spacing: 2px; }
.social-account-name { display: block; margin: 12px 0 14px; color: #425066; font-size: 12px; font-weight: 600; }
.social-metrics { display: grid; grid-template-columns: repeat(3, 1fr); padding-bottom: 14px; border-bottom: 1px solid #f0f2f6; }
.social-metrics div { display: grid; gap: 3px; }
.social-metrics div + div { padding-left: 12px; border-left: 1px solid #f0f2f6; }
.social-metrics span { color: #a0a9b5; font-size: 9px; }
.social-metrics strong { color: #637087; font-size: 16px; font-weight: 600; }
.social-card-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 11px; color: #a0a9b5; font-size: 10px; }
.data-waiting { display: inline-flex; align-items: center; gap: 6px; }
.add-account-card { display: grid; align-content: center; justify-items: center; gap: 7px; border-style: dashed; background: #fafbfd; text-align: center; }
.add-account-icon { display: grid; width: 33px; height: 33px; place-items: center; margin-bottom: 1px; border: 1px solid #e3e8f0; border-radius: 10px; color: #8390a2; font-size: 20px; }
.add-account-card > strong { color: #68758a; font-size: 12px; font-weight: 600; }
.add-account-card > span { color: #9da7b4; font-size: 10px; }
.text-button { margin-top: 2px; padding: 0; border: 0; background: transparent; color: #8995a7; font-size: 10px; }
.text-button:disabled { cursor: not-allowed; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding: 16px 0; border-top: 1px solid #e5eaf0; color: #9aa4b1; font-size: 10px; }
.menu-toggle, .sidebar-backdrop { display: none; }

@media (max-width: 1100px) {
  .sidebar { width: 220px; }
  .main-column { margin-left: 220px; }
  .topbar { padding: 0 28px; }
  main { width: min(100% - 56px, 1240px); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .social-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .sidebar { width: min(280px, 84vw); transform: translateX(-102%); transition: transform 300ms cubic-bezier(.22,1,.36,1); }
  body.menu-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 15; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: rgb(12 19 31 / 42%); opacity: 0; pointer-events: none; transition: opacity 250ms cubic-bezier(.22,1,.36,1); }
  body.menu-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .main-column { margin-left: 0; }
  .topbar { height: 60px; justify-content: flex-start; gap: 12px; padding: 0 18px; }
  .menu-toggle { display: grid; width: 34px; height: 34px; align-content: center; justify-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
  .menu-toggle span { width: 14px; height: 1.5px; border-radius: 2px; background: #536075; transition: transform 250ms cubic-bezier(.22,1,.36,1); }
  body.menu-open .menu-toggle span:first-child { transform: translateY(3.25px) rotate(45deg); }
  body.menu-open .menu-toggle span:last-child { transform: translateY(-3.25px) rotate(-45deg); }
  .breadcrumb { font-size: 11px; }
  .topbar-actions { gap: 8px; margin-left: auto; }
  .updated-label { font-size: 0; }
  .updated-label .status-dot { width: 8px; height: 8px; }
  .icon-button { width: 32px; height: 32px; }
  main { width: calc(100% - 36px); padding-top: 27px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 22px; }
  h1 { font-size: 24px; }
  .page-description { font-size: 12px; }
  .period-control { min-height: 38px; }
  .metric-grid { gap: 10px; }
  .metric-card { min-height: 132px; padding: 14px; }
  .metric-top { align-items: flex-start; gap: 6px; font-size: 10px; }
  .metric-icon { width: 27px; height: 27px; flex: 0 0 auto; font-size: 14px; }
  .metric-value { margin-top: 11px; font-size: 23px; }
  .metric-foot { align-items: flex-start; flex-direction: column; gap: 2px; margin-top: 10px; font-size: 9px; }
  .content-section { margin-top: 28px; }
  .section-heading { align-items: center; }
  h2 { font-size: 15px; }
  .source-pill { padding: 4px 7px; font-size: 9px; }
  .chart-card { min-height: 250px; }
  .chart-toolbar { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; padding: 9px 12px; }
  .chart-period { font-size: 9px; }
  .chart-empty { min-height: 190px; }
  .chart-empty > span { max-width: 260px; font-size: 10px; }
  .social-grid { grid-template-columns: 1fr; gap: 10px; }
  .social-card { min-height: 185px; }
  .add-account-card { min-height: 165px; }
  .page-footer { flex-direction: column; margin-top: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
