:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #fbfcfd;
  --surface-hover: #f1f3f6;
  --ink: #20252d;
  --ink-strong: #161b22;
  --muted: #7c8491;
  --muted-2: #a2a9b3;
  --line: #e8ebef;
  --line-strong: #dce1e7;
  --accent: #5c69d9;
  --accent-dark: #4a57c2;
  --accent-soft: #eef0ff;
  --green: #289b76;
  --green-soft: #e8f6f1;
  --red: #d66b71;
  --red-soft: #fff0f1;
  --orange: #bd843c;
  --shadow: 0 12px 36px rgba(30, 40, 62, .07);
  --sidebar: #20242c;
  --sidebar-ink: #d5d9e0;
  --sidebar-muted: #8d96a4;
  --sidebar-line: #343a45;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171a20;
  --surface: #20242c;
  --surface-soft: #1c2027;
  --surface-hover: #2a303a;
  --ink: #cbd1da;
  --ink-strong: #f0f2f5;
  --muted: #929ba9;
  --muted-2: #727d8c;
  --line: #333a46;
  --line-strong: #424b59;
  --accent: #8892ff;
  --accent-dark: #a0a8ff;
  --accent-soft: #2d3353;
  --green: #60c3a1;
  --green-soft: #243c37;
  --red: #f08b91;
  --red-soft: #472d34;
  --orange: #e0b06b;
  --shadow: 0 12px 36px rgba(0, 0, 0, .2);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-size: 13px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.boot-screen { min-height: 100vh; display: flex; gap: 12px; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.brand-mark { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 9px; background: linear-gradient(145deg, #7d86ed, #505cc7); color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -1px; box-shadow: 0 5px 12px rgba(90, 103, 213, .25); }
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-strong); font-size: 16px; font-weight: 760; letter-spacing: -.5px; }
.brand-light { font-weight: 430; color: var(--muted); }
.eyebrow { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 1.15px; }
.muted { color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 38px; padding: 0 15px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; font-weight: 650; transition: background .15s, border-color .15s, transform .15s; }
.button:disabled { opacity: .6; cursor: wait; }
.button-primary { color: white; background: var(--accent); box-shadow: 0 3px 8px rgba(92, 105, 217, .15); }
.button-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.button-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.button-secondary:hover, .button-quiet:hover { background: var(--surface-hover); }
.button-quiet { color: var(--muted); background: transparent; border-color: transparent; }
.button-small { min-height: 31px; padding: 0 10px; font-size: 11px; }
.button-wide { width: 100%; }
.text-link { color: var(--accent); font-size: 12px; font-weight: 650; }
.alert { border-radius: 8px; padding: 12px 14px; margin: 14px 0; font-size: 12px; line-height: 1.55; }
.alert-error { color: #a6444e; background: var(--red-soft); border: 1px solid rgba(214, 107, 113, .22); }
.alert ul { margin: 8px 0 0; padding-left: 17px; }
.alert button { float: right; border: 0; background: transparent; color: inherit; text-decoration: underline; }
/* Authentication */
.auth-body, .installer-body { min-height: 100vh; background: radial-gradient(ellipse at 50% 0%, rgba(99, 112, 224, .09), transparent 48%), var(--bg); overflow-x: hidden; }
.auth-orbit { position: fixed; border: 1px solid rgba(105, 116, 218, .1); border-radius: 50%; pointer-events: none; }
.auth-orbit-a { width: 620px; height: 620px; top: -360px; left: calc(50% - 310px); }
.auth-orbit-b { width: 900px; height: 900px; top: -520px; left: calc(50% - 450px); }
.auth-wrap { position: relative; z-index: 1; width: min(420px, calc(100% - 32px)); margin: 0 auto; padding-top: 10vh; }
.auth-wrap .brand-lockup { margin: 0 0 28px 5px; }
.auth-card { padding: 35px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.auth-card h1 { margin: 8px 0 7px; color: var(--ink-strong); font-size: 25px; letter-spacing: -.8px; }
.auth-card > p { margin: 0 0 26px; font-size: 12px; }
.stack-form { display: grid; gap: 15px; }
.stack-form label, .installer-form label { display: grid; gap: 7px; color: var(--ink); font-size: 11px; font-weight: 650; }
.stack-form input, .installer-form input, .installer-form select, .stack-form select { width: 100%; height: 40px; padding: 0 12px; color: var(--ink-strong); background: var(--surface-soft); border: 1px solid var(--line-strong); border-radius: 6px; outline: none; font-size: 12px; font-weight: 450; }
.stack-form input:focus, .installer-form input:focus, .installer-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-card .button { margin-top: 5px; }
.auth-footer { text-align: center; margin-top: 22px; color: var(--muted-2); font-size: 10px; }
/* Installer */
.installer-topbar { height: 72px; padding: 0 max(28px, calc((100% - 1260px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); }
.version-pill, .step-count { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .8px; border: 1px solid var(--line); border-radius: 30px; padding: 7px 10px; }
.installer-layout { width: min(1260px, calc(100% - 48px)); margin: 44px auto 56px; display: grid; grid-template-columns: minmax(260px, .76fr) minmax(540px, 1.24fr); gap: clamp(38px, 7vw, 100px); align-items: start; }
.installer-intro { padding: 30px 0 0 8px; position: sticky; top: 35px; }
.installer-intro h1 { margin: 16px 0 16px; color: var(--ink-strong); font-size: clamp(34px, 4vw, 49px); line-height: 1.09; letter-spacing: -2px; }
.installer-intro h1 span { color: var(--accent); }
.installer-intro > p { max-width: 340px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.installer-steps { margin-top: 42px; display: grid; gap: 22px; }
.installer-step { display: flex; gap: 13px; align-items: center; opacity: .55; }
.installer-step.is-active { opacity: 1; }
.installer-step > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); font-size: 10px; font-weight: 750; }
.installer-step.is-active > span { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.installer-step strong, .installer-step small { display: block; }
.installer-step strong { font-size: 12px; color: var(--ink-strong); }
.installer-step small { margin-top: 3px; font-size: 10px; color: var(--muted); }
.installer-note { margin-top: 45px; max-width: 310px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.note-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface); color: var(--accent); font-size: 20px; }
.installer-card { padding: 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 7px 0 0; color: var(--ink-strong); font-size: 21px; letter-spacing: -.5px; }
.step-count { border: 0; background: var(--accent-soft); color: var(--accent); }
.step-count i { color: var(--muted-2); font-style: normal; padding: 0 3px; }
.environment-panel { margin: 22px 0 28px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink-strong); font-size: 11px; }
.panel-title > span { color: var(--muted); font-size: 10px; font-weight: 450; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 18px; margin-top: 16px; }
.check-item { min-width: 0; display: flex; gap: 8px; align-items: flex-start; }
.check-indicator { width: 17px; height: 17px; flex: 0 0 17px; display: grid; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 800; }
.check-indicator.ok { color: var(--green); background: var(--green-soft); }
.check-indicator.bad { color: var(--red); background: var(--red-soft); }
.check-indicator.warn { color: var(--orange); background: rgba(189, 132, 60, .12); }
.check-item strong, .check-item small { display: block; }
.check-item strong { color: var(--ink); font-size: 10px; }
.check-item small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.hint { color: var(--muted); font-size: 10px; line-height: 1.55; margin: 13px 0 0; }
.installer-form { display: grid; gap: 13px; }
.form-section-title { display: flex; align-items: center; gap: 10px; margin: 3px 0 2px; }
.form-section-title > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 750; }
.form-section-title strong, .form-section-title small { display: block; }
.form-section-title strong { color: var(--ink-strong); font-size: 12px; }
.form-section-title small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 450; }
.installer-form label { font-size: 10px; }
.installer-form input, .installer-form select { height: 37px; background: var(--surface-soft); font-size: 11px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-divider { height: 1px; background: var(--line); margin: 7px 0; }
.mysql-fields { display: grid; gap: 12px; padding: 13px; border-radius: 7px; background: var(--surface-soft); border: 1px solid var(--line); }
.mysql-fields[hidden] { display: none; }
.field-help { color: var(--muted); font-size: 9px; font-weight: 450; }
.installer-submit { margin-top: 8px; height: 43px; }
.form-legal { color: var(--muted-2); font-size: 9px; line-height: 1.5; text-align: center; margin: 0; }
.installer-footer { padding: 0 24px 28px; text-align: center; color: var(--muted-2); letter-spacing: 1.1px; font-size: 9px; font-weight: 750; }
.installer-footer span { padding: 0 5px; color: var(--accent); }
.complete-wrap { width: min(660px, calc(100% - 32px)); margin: 9vh auto; text-align: center; }
.complete-icon { width: 58px; height: 58px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 18px; color: var(--green); background: var(--green-soft); font-size: 27px; font-weight: 700; }
.complete-wrap h1 { color: var(--ink-strong); font-size: 32px; letter-spacing: -1.2px; margin: 9px 0; }
.complete-wrap > p { max-width: 530px; margin: 0 auto; line-height: 1.7; font-size: 12px; }
.snippet-card { margin: 32px 0 23px; padding: 18px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); }
.snippet-card pre { overflow-x: auto; margin: 15px 0 10px; padding: 14px; background: #20242c; color: #dce4ff; border-radius: 6px; font: 11px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.snippet-card > small { color: var(--muted); font-size: 10px; }
.complete-links { display: flex; justify-content: center; align-items: center; gap: 20px; }
.complete-security { margin-top: 30px !important; color: var(--muted-2); font-size: 10px !important; }
/* Application shell */
.app-body { min-height: 100vh; background: var(--bg); }
.sidebar { width: 238px; min-height: 100vh; position: fixed; inset: 0 auto 0 0; z-index: 10; display: flex; flex-direction: column; padding: 0 13px 15px; background: var(--sidebar); color: var(--sidebar-ink); transition: width .2s, transform .2s; }
.sidebar-brand { height: 67px; display: flex; align-items: center; gap: 10px; padding: 0 10px; color: #f5f6fa; font-size: 15px; font-weight: 750; letter-spacing: -.5px; border-bottom: 1px solid var(--sidebar-line); white-space: nowrap; }
.sidebar-brand .brand-mark { width: 27px; height: 27px; font-size: 16px; border-radius: 8px; }
.sidebar-brand .brand-light { color: #a2aab7; }
.sidebar-collapse { margin-left: auto; width: 24px; height: 24px; border: 0; border-radius: 5px; color: var(--sidebar-muted); background: transparent; font-size: 20px; }
.sidebar-collapse:hover { background: #303641; color: white; }
.workspace-label { padding: 22px 10px 10px; color: #727c8b; font-size: 8px; font-weight: 800; letter-spacing: 1.2px; }
.nav-group { padding: 8px 0 12px; }
.nav-group-title { padding: 0 10px 7px; color: #727c8b; font-size: 8px; font-weight: 800; letter-spacing: 1.1px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 35px; margin: 2px 0; padding: 0 10px; color: #aeb6c2; background: transparent; border: 0; border-radius: 6px; text-align: left; font-size: 11px; font-weight: 520; transition: background .15s, color .15s; }
.nav-item svg { width: 15px; height: 15px; color: #919baa; flex: 0 0 15px; }
.nav-item:hover { color: #fff; background: #2b313b; }
.nav-item.active { color: #fff; background: #343b4b; box-shadow: inset 2px 0 #8b94ff; }
.nav-item.active svg { color: #9ca4ff; }
.nav-count { margin-left: auto; font-size: 9px; color: #a9b1bd; font-style: normal; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--sidebar-line); padding-top: 12px; }
.sidebar-version { display: flex; align-items: center; gap: 7px; padding: 15px 9px 4px; color: #828d9b; font-size: 9px; }
.sidebar-version small { margin-left: auto; color: #687382; font-size: 9px; }
.status-dot, .live-badge i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #55bb91; box-shadow: 0 0 0 3px rgba(85, 187, 145, .12); }
.app-main { min-height: 100vh; margin-left: 238px; transition: margin-left .2s; }
.topbar { height: 67px; position: sticky; top: 0; z-index: 8; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 32px; background: color-mix(in srgb, var(--surface) 93%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 16px; min-width: 0; }
.site-select-wrap { position: relative; display: flex; align-items: center; gap: 9px; }
.site-indicator { width: 8px; height: 8px; border-radius: 3px; background: var(--accent); }
.site-select-wrap select { max-width: 280px; padding: 5px 18px 5px 0; appearance: none; border: 0; outline: 0; background: transparent; color: var(--ink-strong); font-size: 12px; font-weight: 700; cursor: pointer; }
.select-chevron { position: absolute; right: 0; top: 3px; color: var(--muted); pointer-events: none; }
.header-separator { width: 1px; height: 21px; background: var(--line-strong); }
.site-domain-label { max-width: 160px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.range-select { display: flex; flex-direction: column; gap: 1px; color: var(--muted); font-size: 8px; }
.range-select select { border: 0; padding: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10px; font-weight: 650; cursor: pointer; }
.compare-toggle { display: flex; align-items: center; gap: 7px; background: transparent; border: 0; color: var(--muted); font-size: 10px; }
.compare-toggle > span { width: 25px; height: 14px; padding: 2px; border-radius: 10px; background: var(--line-strong); transition: background .15s; }
.compare-toggle > span::after { content: ""; display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.compare-toggle.active { color: var(--ink); }
.compare-toggle.active > span { background: var(--accent); }
.compare-toggle.active > span::after { transform: translateX(11px); }
.icon-button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 16px; }
.icon-button:hover { background: var(--surface-hover); }
.user-menu { display: flex; align-items: center; gap: 8px; padding-left: 13px; border-left: 1px solid var(--line); }
.avatar { width: 29px; height: 29px; display: grid; place-items: center; background: var(--accent-soft); border-radius: 50%; color: var(--accent); font-size: 11px; font-weight: 750; }
.user-menu strong, .user-menu small { display: block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu strong { color: var(--ink); font-size: 10px; }
.user-menu small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.logout-button { width: 25px; height: 25px; border: 0; background: transparent; color: var(--muted); font-size: 16px; }
.mobile-menu-button { display: none; border: 0; background: transparent; color: var(--ink); font-size: 17px; }
.content-area { max-width: 1540px; padding: 32px 35px 18px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 1px 0 23px; }
.page-heading h1 { margin: 6px 0 5px; color: var(--ink-strong); font-size: 24px; letter-spacing: -.8px; font-weight: 730; }
.page-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.heading-actions { display: flex; align-items: center; gap: 12px; }
.live-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 9px; }
.live-badge i { width: 5px; height: 5px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; margin-bottom: 15px; }
.metric-card { min-width: 0; padding: 17px 18px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.metric-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; font-weight: 600; }
.metric-info { display: grid; place-items: center; width: 14px; height: 14px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted-2); font-size: 8px; font-weight: 700; cursor: help; }
.metric-value { margin: 14px 0 10px; color: var(--ink-strong); font-size: 28px; line-height: 1; font-weight: 740; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.metric-bottom { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 9px; }
.metric-change { padding: 3px 5px; border-radius: 4px; font-size: 9px; font-weight: 700; }
.metric-change.positive { color: var(--green); background: var(--green-soft); }
.metric-change.negative { color: var(--red); background: var(--red-soft); }
.metric-change.neutral { color: var(--muted); background: var(--surface-hover); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.traffic-panel { padding: 18px 20px 12px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.panel-heading h2 { margin: 0; color: var(--ink-strong); font-size: 12px; font-weight: 730; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.chart-legend { color: var(--muted); font-size: 9px; }
.chart-legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.legend-dot.views { background: var(--accent); }
.legend-dot.previous { width: 13px; height: 0; border-top: 2px dashed var(--muted-2); border-radius: 0; }
.chart-wrap { position: relative; height: 210px; margin: 12px 0 0; }
.traffic-chart { width: 100%; height: 100%; overflow: visible; }
.chart-grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-area { fill: url(#unused); fill: rgba(92, 105, 217, .08); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; }
.chart-axis-label { font-size: 9px; fill: var(--muted-2); }
.chart-y-label { font-size: 8px; fill: var(--muted-2); text-anchor: start; }
.chart-empty { height: 100%; display: grid; place-items: center; color: var(--muted-2); font-size: 11px; }
.chart-tooltip { position: absolute; z-index: 3; min-width: 190px; max-width: 245px; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); box-shadow: 0 12px 30px rgba(0,0,0,.22); color: var(--ink); pointer-events: none; font-size: 9px; }
.chart-tooltip[hidden] { display: none; }
.chart-tooltip-date { display: block; margin-bottom: 8px; color: var(--ink-strong); font-size: 10px; }
.chart-tooltip-value { display: grid; grid-template-columns: 8px minmax(0,1fr) auto auto; align-items: center; gap: 6px; min-height: 20px; }
.chart-tooltip-value i { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }
.chart-tooltip-value i.visitors { background: #54b59a; }
.chart-tooltip-value b { color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.chart-tooltip-value small { color: var(--green); font-size: 8px; }
.chart-tooltip-compare { display: grid; gap: 4px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.chart-tooltip-compare strong { color: var(--muted); font-weight: 550; }
.chart-foot { display: flex; gap: 20px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 14px; }
.report-panel, .summary-panel { min-width: 0; padding: 17px 18px 12px; }
.panel-tabs { display: flex; align-items: center; gap: 17px; min-height: 37px; margin-top: 9px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.panel-tab { flex: 0 0 auto; height: 37px; padding: 0 1px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 10px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.panel-tab:hover { color: var(--ink); }
.panel-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabbed-panel .report-list { margin-top: 8px; }
.tab-empty-state { min-height: 155px; display: grid; align-content: center; justify-items: center; gap: 8px; padding: 22px; text-align: center; }
.tab-empty-state > span { color: var(--accent); font-size: 22px; }
.tab-empty-state strong { color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.tab-empty-state p { max-width: 340px; margin: 0; color: var(--muted-2); font-size: 9px; line-height: 1.7; }
.report-grid-span { grid-column: 1 / -1; min-width: 0; }
.panel-more { border: 0; background: transparent; color: var(--accent); font-size: 9px; font-weight: 650; }
.report-list { margin-top: 12px; }
.report-row { width: 100%; height: 32px; display: grid; grid-template-columns: minmax(100px, 1fr) minmax(65px, 1fr) 42px; gap: 14px; align-items: center; padding: 0; background: transparent; border: 0; text-align: left; }
.report-row:hover .report-name { color: var(--accent); }
.report-name { min-width: 0; color: var(--ink); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-bar { height: 5px; background: var(--surface-hover); border-radius: 6px; overflow: hidden; }
.report-bar i { height: 100%; min-width: 2px; display: block; background: var(--accent); border-radius: 6px; opacity: .8; }
.report-row strong { color: var(--ink); font-size: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.empty-report { padding: 22px 0; color: var(--muted-2); font-size: 10px; text-align: center; }
.summary-stat { display: flex; justify-content: space-between; align-items: center; padding: 22px 0 16px; }
.summary-stat strong { display: block; color: var(--ink-strong); font-size: 25px; letter-spacing: -.7px; }
.summary-stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.summary-icon { width: 38px; height: 38px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 10px; font-size: 19px; }
.summary-foot { padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9px; line-height: 1.6; }
.app-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 29px; padding: 13px 1px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 8px; letter-spacing: .2px; }
.app-footer span:first-child { font-weight: 800; letter-spacing: 1px; }
.empty-site { min-height: 460px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.empty-site-icon { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-size: 26px; }
.empty-site h2 { margin: 18px 0 7px; color: var(--ink-strong); font-size: 18px; }
.empty-site p { max-width: 340px; margin: 0 0 19px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.full-report-panel, .settings-panel { padding: 19px 21px; margin-bottom: 14px; }
.report-table-head, .report-table-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; min-height: 38px; padding: 0 8px; border-bottom: 1px solid var(--line); }
.report-table-head { margin-top: 17px; color: var(--muted); background: var(--surface-soft); font-size: 9px; font-weight: 700; }
.report-table-row { color: var(--ink); font-size: 10px; }
.report-table-row strong { font-variant-numeric: tabular-nums; }
.feature-placeholder { min-height: 270px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.placeholder-mark { color: var(--accent); font-size: 26px; }
.feature-placeholder h3 { margin: 11px 0 6px; color: var(--ink-strong); font-size: 15px; }
.feature-placeholder p { max-width: 390px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.roadmap-label { margin-top: 10px; padding: 5px 8px; color: var(--muted); background: var(--surface-hover); border-radius: 4px; font-size: 8px; font-weight: 750; letter-spacing: .7px; }
.site-count { color: var(--muted); font-size: 9px; }
.site-list { margin-top: 13px; }
.site-item { display: flex; align-items: center; gap: 12px; min-height: 74px; border-bottom: 1px solid var(--line); }
.site-item:last-child { border-bottom: 0; }
.site-avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-weight: 800; }
.site-detail { min-width: 0; display: grid; gap: 4px; }
.site-detail strong { color: var(--ink-strong); font-size: 11px; }
.site-detail span { color: var(--muted); font-size: 9px; }
.site-detail code { color: var(--muted-2); font-size: 8px; }
.site-item .button { margin-left: auto; flex-shrink: 0; }
.status-chip { border-radius: 5px; padding: 5px 8px; font-size: 9px; font-weight: 700; }
.status-chip.ok { color: var(--green); background: var(--green-soft); }
.infra-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding-top: 20px; }
.infra-grid div { display: grid; gap: 7px; padding: 12px; background: var(--surface-soft); border-radius: 6px; }
.infra-grid span { color: var(--muted); font-size: 9px; }
.infra-grid strong { color: var(--ink); font-size: 11px; }
.loading-state { min-height: 440px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 11px; }
.loading-spinner { width: 15px; height: 15px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(15, 20, 31, .48); backdrop-filter: blur(3px); }
.modal-card { width: min(460px, 100%); max-height: min(90vh, 740px); overflow-y: auto; position: relative; padding: 27px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 24px 80px rgba(0, 0, 0, .25); }
.modal-card h2 { margin: 7px 0 5px; color: var(--ink-strong); font-size: 21px; letter-spacing: -.5px; }
.modal-card > p { margin: 0 0 22px; font-size: 11px; }
.modal-close { position: absolute; top: 15px; right: 15px; width: 27px; height: 27px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 20px; }
.modal-close:hover { background: var(--surface-hover); }
.modal-error { color: var(--red); font-size: 10px; line-height: 1.5; }
/* Responsive */
.sidebar-collapsed .sidebar { width: 70px; padding-inline: 9px; }
.sidebar-collapsed .app-main { margin-left: 70px; }
.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar-brand > span:not(.brand-mark), .sidebar-collapsed .sidebar-collapse, .sidebar-collapsed .workspace-label, .sidebar-collapsed .nav-group-title, .sidebar-collapsed .nav-item span, .sidebar-collapsed .nav-count, .sidebar-collapsed .sidebar-version { display: none; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
@media (max-width: 1180px) {
  .topbar { padding: 0 22px; }
  .content-area { padding: 28px 22px 16px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-menu small { display: none; }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); width: 238px; box-shadow: var(--shadow); }
  .app-main, .sidebar-collapsed .app-main { margin-left: 0; }
  .mobile-nav-open .sidebar { transform: translateX(0); }
  .mobile-menu-button { display: block; }
  .topbar { height: 59px; padding: 0 14px; gap: 8px; }
  .topbar-left, .topbar-right { gap: 9px; }
  .site-domain-label, .header-separator { display: none; }
  .site-select-wrap select { max-width: 160px; font-size: 10px; }
  .user-menu { padding-left: 6px; border: 0; }
  .user-menu > div { display: none; }
  .content-area { padding: 23px 14px 12px; }
  .report-grid { grid-template-columns: 1fr; }
  .report-grid-span { grid-column: auto; }
  .infra-grid { grid-template-columns: repeat(2, 1fr); }
  .installer-layout { grid-template-columns: 1fr; width: min(620px, calc(100% - 28px)); margin-top: 20px; gap: 20px; }
  .installer-intro { position: static; padding: 5px 3px 0; }
  .installer-intro h1 { font-size: 34px; }
  .installer-intro > p { max-width: 540px; }
  .installer-steps, .installer-note { display: none; }
}
@media (max-width: 560px) {
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric-card { padding: 13px 12px; }
  .metric-value { font-size: 23px; }
  .metric-top { font-size: 9px; }
  .metric-bottom { flex-wrap: wrap; gap: 4px; font-size: 8px; }
  .topbar-right { gap: 7px; }
  .compare-toggle { font-size: 0; gap: 0; }
  .range-select span { display: none; }
  .range-select select { max-width: 90px; font-size: 9px; }
  .icon-button { width: 26px; height: 26px; }
  .heading-actions .button { min-height: 31px; padding: 0 9px; }
  .page-heading h1 { font-size: 22px; }
  .page-heading p { max-width: 220px; line-height: 1.5; }
  .chart-wrap { height: 170px; }
  .chart-foot { gap: 10px; font-size: 8px; }
  .report-row { grid-template-columns: minmax(90px, 1fr) 80px 35px; gap: 8px; }
  .app-footer { flex-direction: column; gap: 6px; }
  .installer-topbar { height: 60px; padding: 0 15px; }
  .version-pill { font-size: 8px; }
  .installer-card { padding: 19px 15px; }
  .check-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .complete-wrap h1 { font-size: 26px; }
  .complete-links { flex-direction: column; gap: 14px; }
  .site-item { align-items: flex-start; padding: 12px 0; }
  .site-item .button { padding: 0 7px; }
  .site-detail code { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  .modal-card { padding: 22px 17px; }
}
.credential-modal { max-width: 520px; }
.credential-modal h2 { margin: 8px 0 6px; font-size: 20px; color: var(--ink-strong); }
.credential-modal label { display: block; margin: 17px 0 7px; color: var(--ink); font-size: 10px; font-weight: 700; }
.credential-code { max-height: 100px; overflow: auto; margin: 8px 0; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-hover); color: var(--ink); font: 10px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.wizard-step[hidden], .mysql-fields[hidden] { display: none !important; }
.wizard-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.wizard-nav > span { color: var(--muted-2); font-size: 9px; font-weight: 650; }
.installer-step.is-complete > span { background: var(--green-soft); color: var(--green); }
.installer-step.is-complete > span::before { content: '✓'; }
.installer-step.is-complete > span { font-size: 0; }
.installer-step.is-complete > span::before { font-size: 11px; }
.review-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 18px 0 6px; }
.review-row { min-width: 0; display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); }
.review-row span { color: var(--muted); font-size: 9px; }
.review-row strong { overflow-wrap: anywhere; color: var(--ink); font-size: 10px; font-weight: 700; }
@media (max-width: 560px) { .review-summary { grid-template-columns: 1fr; } .wizard-nav { gap: 7px; } .wizard-nav .button { padding-inline: 10px; } }

/* Pirsch-inspired reporting controls and language-aware dashboard components. */
:root { --font-latin: "Alma Latin Custom", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --font-persian: "Vazirmatn", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, Arial, sans-serif; font-family: var(--font-latin); }
:root[data-language="fa"] { font-family: var(--font-persian); }
:root[data-language="fa"] body, :root[data-language="fa"] button, :root[data-language="fa"] input, :root[data-language="fa"] select { font-family: var(--font-persian); }
:root[data-language="fa"] .eyebrow, :root[data-language="fa"] .nav-group-title, :root[data-language="fa"] .workspace-label { letter-spacing: 0; }
:root[data-language="fa"] .page-heading h1, :root[data-language="fa"] .metric-value { letter-spacing: 0; }
:root[data-language="fa"] .metric-value { font-variant-numeric: tabular-nums; }
:root[data-language="fa"] .language-fa-numbers { font-variant-numeric: normal; }

.site-select-wrap > svg { position: absolute; inset-inline-end: 0; top: 5px; width: 13px; height: 13px; color: var(--muted); pointer-events: none; }
.site-select-wrap select { padding-inline-end: 20px; }
.language-select { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; height: 30px; background: var(--surface); }
.language-select select { min-width: 28px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 9px; font-weight: 750; cursor: pointer; }
.language-icon { font-size: 13px; }
.filter-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -8px 0 15px; min-height: 43px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.filter-toolbar-main, .filter-toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.filter-toolbar-main > svg { width: 15px; height: 15px; color: var(--muted); }
.filter-toolbar-title { color: var(--ink); font-size: 10px; font-weight: 700; padding-inline-end: 5px; }
.filter-empty { color: var(--muted-2); font-size: 9px; }
.filter-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 340px; min-height: 25px; padding: 3px 5px 3px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); color: var(--muted); font-size: 9px; }
.filter-chip strong { color: var(--muted); font-weight: 550; }
.filter-chip b { overflow: hidden; color: var(--ink); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip button { width: 18px; height: 18px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 14px; line-height: 1; }
.filter-chip button:hover { color: var(--red); background: var(--red-soft); }
.filter-clear, .filter-add { border: 0; background: transparent; color: var(--accent); font-size: 9px; font-weight: 700; white-space: nowrap; }
.filter-clear { color: var(--muted); }
.metric-card { position: relative; overflow: hidden; }
.metric-symbol { position: absolute; inset-inline-end: 14px; bottom: 13px; color: var(--accent); opacity: .10; font-size: 33px; font-weight: 700; pointer-events: none; }
.metric-value { position: relative; z-index: 1; }
.chart-legend { display: flex; gap: 14px; }
.legend-dot.visitors { background: #54b59a; }
.chart-line { fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.views-line { stroke: var(--accent); }
.visitors-line { stroke: #54b59a; stroke-dasharray: 4 4; stroke-width: 1.8; }
.visitors-dot { fill: #54b59a; }
.previous-views-line { stroke: var(--accent); opacity: .42; stroke-dasharray: 5 5; stroke-width: 1.7; }
.previous-visitors-line { stroke: #54b59a; opacity: .42; stroke-dasharray: 2 5; stroke-width: 1.7; }
.previous-views-dot { stroke: var(--accent); opacity: .45; }
.previous-visitors-dot { stroke: #54b59a; opacity: .45; }
.views-dot { fill: var(--accent); }
.report-row-action, .report-table-row { width: 100%; border: 0; text-align: start; font: inherit; cursor: pointer; }
.report-row-action { background: transparent; }
.report-row-action:hover .report-name, .report-table-row:hover span { color: var(--accent); }
.report-table-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 39px; padding: 0 8px; background: transparent; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 10px; }
.report-table-row strong { font-variant-numeric: tabular-nums; }
.report-total { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.filter-modal { width: min(520px, 100%); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; }
.settings-language-select { display: grid; gap: 7px; width: min(260px, 100%); margin-top: 18px; color: var(--muted); font-size: 10px; font-weight: 650; }
.settings-language-select select { height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface-soft); color: var(--ink); }
.language-settings .panel-heading p { max-width: 690px; line-height: 1.7; }
.language-settings-grid { display: flex; align-items: end; flex-wrap: wrap; gap: 34px; }
.font-preview { display: grid; gap: 6px; margin-top: 18px; color: var(--muted); font-size: 10px; }
.font-preview strong { color: var(--ink); font-size: 10px; }
.font-preview span[lang="fa"] { font-family: var(--font-persian); font-size: 14px; color: var(--ink-strong); }
.font-preview code { color: var(--muted-2); font-size: 9px; }

/* Right-to-left application shell. Physical side offsets are mirrored while
   DOM and API values remain locale-neutral and stable. */
html[dir="rtl"] .sidebar { inset: 0 0 0 auto; }
html[dir="rtl"] .app-main { margin-left: 0; margin-right: 238px; }
html[dir="rtl"] .sidebar-collapse { margin-left: 0; margin-right: auto; transform: rotate(180deg); }
html[dir="rtl"] .nav-item { text-align: right; }
html[dir="rtl"] .nav-item.active { box-shadow: inset -2px 0 #8b94ff; }
html[dir="rtl"] .nav-count { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .sidebar-version small { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .topbar { direction: rtl; }
html[dir="rtl"] .compare-toggle.active > span::after { transform: translateX(-11px); }
html[dir="rtl"] .user-menu { padding-left: 0; padding-right: 13px; border-left: 0; border-right: 1px solid var(--line); }
html[dir="rtl"] .logout-button { transform: scaleX(-1); }
html[dir="rtl"] .report-row { direction: rtl; }
html[dir="rtl"] .report-row strong, html[dir="rtl"] .metric-value { direction: ltr; text-align: right; }
html[dir="rtl"] .report-table-head, html[dir="rtl"] .report-table-row { direction: rtl; }
html[dir="rtl"] .filter-chip { direction: rtl; }
html[dir="rtl"] .modal-card { direction: rtl; text-align: right; }
html[dir="rtl"] .credential-code { direction: ltr; text-align: left; }
html[dir="rtl"] .app-footer { direction: rtl; }
html[dir="rtl"] .sidebar-collapsed .app-main { margin-left: 0; margin-right: 70px; }
html[dir="rtl"] .site-select-wrap select { text-align: right; }
html[dir="rtl"] .site-select-wrap > svg { transform: rotate(90deg); }
html[dir="rtl"] .metric-bottom { direction: rtl; }

@media (max-width: 820px) {
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  html[dir="rtl"] .mobile-nav-open .sidebar { transform: translateX(0); }
  html[dir="rtl"] .app-main, html[dir="rtl"] .sidebar-collapsed .app-main { margin: 0; }
  .filter-toolbar { align-items: flex-start; flex-direction: column; }
  .filter-toolbar-actions { align-self: flex-end; }
}
@media (max-width: 560px) {
  .language-select { height: 27px; padding: 0 5px; }
  .language-icon { display: none; }
  .filter-chip { max-width: min(270px, calc(100vw - 50px)); }
  html[dir="rtl"] .user-menu { padding-right: 5px; }
}
