/* ==============================================
   ADDLINEMEDIA ANALYTICS - Design System (Light Theme)
   Palette: White + light-orange (borders/accents) + black (text) - GA4-simple style
   Type: Inter (all text) + JetBrains Mono (data/numbers)
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --surface-raised: #FFF6E9;
    --border: #F0DCBB;
    --signal: #C97A2E;
    --signal-soft: #FFF6E9;
    --amber: #E2A34F;
    --amber-soft: #FEF7E0;
    --text: #000000;
    --text-muted: #6B6B6B;
    --danger: #D93025;
    --radius: 8px;

    /* Brand palette - STRICTLY white / soft-orange / black(text only). No black used for UI accents - accents are a muted, soft orange (not a bright/neon amber). */
    --c-navy:   #C97A2E;   --c-navy-dark:   #A8621F;   --c-navy-soft:   #FFF6E9;
    --c-green:  #C97A2E;   --c-green-dark:  #A8621F;   --c-green-soft:  #FFF6E9;
    --c-orange: #E2A34F;   --c-orange-dark: #C97A2E;   --c-orange-soft: #FEF7E0;
}

/* ---------- DARK MODE ---------- */
/* Sirf core structural variables badalte hain (background/surface/text/border) -
   brand colors (navy/green/orange) waise hi rehte hain taake identity consistent
   rahe. Kuch bahut khaas-tarah k inline-colored panels (jaise chhote alert
   banners) is theme se pura match nahi karenge, lekin readable rahenge - poori
   app ko dark banana bohot bara scope hota, is liye core chrome (sidebar,
   cards, text, tables) ko priority di hai jo sabse zyada dikhta hai */
[data-theme="dark"] {
    --bg: #131314;
    --surface: #1E1F20;
    --surface-raised: #28292A;
    --border: #3C4043;
    --signal-soft: #000000;
    --amber-soft: #332B14;
    --text: #E8EAED;
    --text-muted: #9AA0A6;
    --c-navy-soft: #000000;
    --c-green-soft: #000000;
    --c-orange-soft: #332B14;
}
[data-theme="dark"] img, [data-theme="dark"] .worldmap-square { opacity: 0.92; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: hidden; max-width: 100vw; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    line-height: 1.5;
    overflow-x: hidden;
    max-width: 100vw;
}

h1, h2, h3, .display {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.mono, .stat-value, .metric {
    font-family: 'JetBrains Mono', monospace;
}

a { color: var(--signal); text-decoration: none; }

/* ---------- Layout ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0; border-bottom: 1px solid var(--border);
}
.logo-badge {
    width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
    background: linear-gradient(135deg, #C97A2E, #E8B368 60%, #E2A34F);
    color: #fff; font-family: 'Inter', sans-serif; font-weight: 800; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(227,116,0,0.35);
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 22px; border-radius: 8px; font-weight: 600; font-size: 14px;
    border: none; cursor: pointer; transition: all 0.15s ease; font-family: 'Inter', sans-serif;
}
.btn-primary {
    background: var(--c-orange);
    color: #fff; font-weight: 600;
    box-shadow: none;
}
.btn-primary:hover { background: var(--c-navy-dark); box-shadow: none; }
.btn-primary:active { box-shadow: none; }
.btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--c-orange); color: var(--text); }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 90px 0 60px; text-align: center; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px;
    border: 1px solid var(--border); border-radius: 100px; font-size: 12px;
    color: var(--text-muted); margin-bottom: 24px; font-family: 'JetBrains Mono', monospace; background: #fff;
}
.hero h1 { font-size: 52px; line-height: 1.1; margin-bottom: 20px; color: var(--text); }
.hero h1 span { color: var(--signal); }
.hero p.sub { color: var(--text-muted); font-size: 18px; max-width: 560px; margin: 0 auto 36px; }
.hero-ctas { display: flex; gap: 14px; justify-content: center; }

/* ---------- Live pulse ticker ---------- */
.pulse-strip {
    margin: 60px auto 0; max-width: 720px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 28px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px;
    box-shadow: 0 2px 10px rgba(227,116,0,0.07);
}
.pulse-item { text-align: left; }
.pulse-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 6px; }
.pulse-value { font-size: 24px; font-weight: 600; color: var(--signal); }
.pulse-value.amber { color: var(--amber); }

/* ---------- Cards / Pricing ---------- */
.section { padding: 70px 0; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-size: 34px; margin-bottom: 12px; color: var(--text); }
.section-head p { color: var(--text-muted); }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.price-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px 26px; position: relative; box-shadow: 0 2px 10px rgba(227,116,0,0.07); border-top: 4px solid var(--border);
}
.price-card.c-navy { border-top-color: var(--c-navy); }
.price-card.c-navy .price-amount { color: var(--c-navy); }
.price-card.featured { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal), 0 20px 40px -20px rgba(91,95,239,0.35); }
.price-tag { position: absolute; top: -12px; right: 24px; background: var(--signal); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 100px; text-transform: uppercase; }
.price-card h3 { font-size: 18px; color: var(--text-muted); font-weight: 500; margin-bottom: 14px; }
.price-amount { font-size: 42px; font-weight: 700; font-family: 'Inter', sans-serif; margin-bottom: 4px; color: var(--text); }
.price-amount span { font-size: 16px; color: var(--text-muted); font-weight: 400; }
.price-sessions { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.price-features { list-style: none; margin-bottom: 28px; }
.price-features li { padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-muted); display: flex; gap: 10px; }
.price-features li:before { content: '✓'; color: var(--signal); font-weight: 700; }

/* ---------- Forms / Auth ---------- */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 24px;
    background: var(--bg);
}
.auth-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 44px; width: 100%; max-width: 400px; text-align: center;
    box-shadow: 0 4px 16px rgba(23,27,46,0.06);
}
.auth-card h1 { font-size: 24px; margin-bottom: 8px; color: var(--text); }
.auth-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 30px; }
.auth-logo { font-size: 24px; }
.auth-view { display: none; }
.auth-footnote { color: var(--text-muted); font-size: 13px; }
#googleSignInDiv { display: flex; justify-content: center; }
.trial-badge {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #C97A2E;
    background: var(--amber-soft); padding: 6px 12px; border-radius: 100px; margin-top: 20px;
}

/* Auth form elements */
.form-input { width: 100%; margin-bottom: 10px; }

/* ---------- Password field with show/hide eye toggle ---------- */
.password-field-wrap { position: relative; }
.password-field-wrap input { padding-right: 42px; width: 100%; box-sizing: border-box; }
.password-toggle-btn {
    position: absolute; right: 8px; top: 0; bottom: 10px; height: calc(100% - 10px);
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; cursor: pointer; font-size: 16px;
    padding: 0 6px; color: var(--text-muted); line-height: 1;
}
.password-toggle-btn:hover { color: var(--text); }
.form-input.otp-input { text-align: center; letter-spacing: 6px; font-size: 20px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: var(--text-muted); font-size: 12px; }
.auth-divider span { flex: 1; height: 1px; background: var(--border); }
.auth-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 4px; }
.auth-sublink { margin-top: 12px; font-size: 13px; }

/* ---------- Dashboard ---------- */
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; }

.dash-wrap { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }

.trial-banner {
    background: var(--amber-soft); border: 1px solid var(--amber); border-radius: var(--radius);
    padding: 14px 20px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; flex-wrap: wrap; gap: 10px; color: #C97A2E;
}
.trial-banner a { color: #C97A2E; font-weight: 600; }

.add-site-panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; margin-bottom: 24px; box-shadow: 0 2px 10px rgba(227,116,0,0.07);
}
.add-site-panel h2 { font-size: 16px; margin-bottom: 16px; color: var(--text); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
input, select {
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    padding: 11px 14px; color: var(--text); font-size: 14px; font-family: 'Inter', sans-serif;
}
input:focus, select:focus { outline: none; border-color: var(--signal); }

/* Site selector - flat white dropdown, GA4-simple style */
#siteSelect {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C97A2E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    color: var(--text); font-weight: 600; font-size: 14px; font-family: 'Inter', sans-serif;
    border: 1px solid var(--border); border-radius: 10px;
    padding: 11px 38px 11px 16px; min-width: 210px;
    box-shadow: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
#siteSelect:hover { border-color: var(--c-orange); }
#siteSelect:focus { border-color: var(--c-orange); outline: none; }
#siteSelect option { background: #fff; color: var(--text); font-weight: 500; }

/* Real-time window selector ("Last 30 minutes") - flat white, GA4-simple */
#rtWindowSelect {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C97A2E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    color: var(--text); font-weight: 600; font-size: 13px; font-family: 'Inter', sans-serif;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 8px 32px 8px 14px;
    box-shadow: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
#rtWindowSelect:hover { border-color: var(--c-orange); }
#rtWindowSelect:focus { border-color: var(--c-orange); outline: none; }
#rtWindowSelect option { background: #fff; color: var(--text); font-weight: 500; }
.snippet-box {
    background: #0B0B0B; color: #e8e8e8; padding: 16px; border-radius: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 12px; margin-top: 14px; overflow-x: auto;
    white-space: pre-wrap; display: none;
}
.snippet-box.status-msg {
    background: var(--c-navy-soft, #FFF6E9); color: var(--text, #202124);
    border: 1px solid var(--border); font-family: 'Inter', sans-serif; font-size: 13px;
    font-weight: 500; white-space: normal;
}

.site-selector { margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }

.stats-strip {
    display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 20px; overflow-x: auto; box-shadow: 0 3px 12px rgba(227,116,0,0.07);
}
.stat-item { flex: 1; min-width: 150px; padding: 18px 24px; border-right: 1px solid var(--border); border-top: 3px solid var(--c-navy); transition: background 0.15s ease; }
.stat-item:hover { background: var(--surface-raised); }
.stat-icon { font-size: 12px; margin-right: 6px; opacity: 0.75; }
#activeNowPulse.pulsing { animation: livepulse 1.5s infinite; }
.stat-item:last-child { border-right: none; }
.stat-item.accent-orange { border-top-color: var(--c-orange); }
.stat-item .label { font-size: 11.5px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.stat-item .stat-value { font-size: 28px; font-weight: 700; color: var(--c-navy); }
.stat-item.accent-orange .stat-value { color: var(--c-orange); }
.trend-badge { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.trend-badge.trend-up { color: #000000; background: rgba(21,128,61,0.1); }
.trend-badge.trend-down { color: #D93025; background: rgba(185,28,28,0.1); }
.trend-badge.trend-flat { color: var(--text-muted); background: var(--surface-raised); }
@media (max-width: 700px) { .stat-item { min-width: 130px; } }

.charts-row { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; animation: panelFadeUp 0.5s ease; }
@keyframes panelFadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.charts-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: 0 2px 10px rgba(227,116,0,0.07); overflow-x: auto; }
.panel.compact-panel { padding: 16px; }
.panel.compact-panel h2 { font-size: 12px; margin-bottom: 8px; }
.panel.dark-panel { background: var(--surface); border: 1px solid var(--border); box-shadow: none; }
.panel.dark-panel h2 { color: var(--text-muted); }
.panel.dark-panel .big-metric-value { color: var(--text); }
.panel.dark-panel .big-metric-label { color: var(--text-muted); }
.panel.dark-panel .device-legend-text { color: var(--text); }
.panel.dark-panel .device-legend-text .pct { color: var(--text); }
.panel h2 { font-size: 15px; margin-bottom: 16px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* Har chart ka fixed height - taake koi chart bara ya chota na ho jaye, sab consistent size mein rahein */
.chart-box { position: relative; height: 220px; width: 100%; }
.compact-panel .chart-box { height: 170px; }

/* ---------- WORLD MAP (Dashboard tab - live traffic map) ---------- */
.worldmap-panel { animation: panelFadeUp 0.5s ease; margin-bottom: 16px; }
.worldmap-panel-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.worldmap-panel-header h2 { margin: 0; display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: normal; font-size: 16px; color: var(--text); }
.worldmap-panel-header h2 .live-dot { width: 8px; height: 8px; }
.worldmap-panel-sub { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

/* 2-column square layout - ek side flat map, doosri side rotating globe */
.worldmap-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.worldmap-square { width: 100%; aspect-ratio: 1 / 1; }
.worldmap-box { position: relative; background: linear-gradient(180deg, #FFFBF3, #FFF6E9); border-radius: 12px; overflow: hidden; }
.worldmap-box svg { border-radius: 12px; }
.worldmap-loading { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); font-size: 13.5px; font-weight: 600; }
.worldmap-globe-wrap { position: relative; background: radial-gradient(circle at 50% 40%, #FFFBF3, #FFF6E9); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.worldmap-globe-wrap canvas { width: 100%; height: 100%; display: block; }

@media (max-width: 900px) {
    .worldmap-split { grid-template-columns: 1fr; }
}

/* Chota version - Real Time / Country page k liye (jaise dashboard wala hi, bas
   kam jagah leta hai - max-width se poora panel bhi chota rehta hai). Ab 3 equal
   boxes ek hi row mein: Active Users, Flat map, Globe */
.worldmap-panel-small { max-width: 900px; margin-bottom: 20px; }
.worldmap-split-small { gap: 10px; }
.worldmap-split-3col { grid-template-columns: 1fr 1fr 1fr; }
.worldmap-square-small { width: 100%; aspect-ratio: 1 / 1; }
.rt-active-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 10px; background: linear-gradient(180deg, #FFFBF3, #FFF6E9);
    border-radius: 12px; padding: 12px;
}
.rt-active-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); line-height: 1.4; }
.rt-active-value { font-size: 42px; font-weight: 800; color: var(--c-navy); line-height: 1; }
@media (max-width: 640px) {
    .worldmap-split-small, .worldmap-split-3col { grid-template-columns: 1fr; }
}

/* jsVectorMap default UI ko brand colors se match karna */
.jvm-zoom-btn { background-color: var(--c-navy) !important; color: #fff !important; border-radius: 6px !important; box-shadow: 0 2px 6px rgba(227,116,0,0.3) !important; }
.jvm-zoom-btn:hover { background-color: var(--c-orange) !important; }
.jvm-tooltip { background-color: #FFFFFF !important; color: var(--text) !important; font-family: inherit !important; font-size: 13px !important; padding: 10px 14px !important; border-radius: 8px !important; box-shadow: 0 6px 20px rgba(227,116,0,0.18) !important; border: 1px solid var(--border) !important; }
.worldmap-tooltip-card { line-height: 1.5; }
.worldmap-tooltip-country { color: #000000; font-weight: 700; font-size: 13.5px; }
.worldmap-tooltip-count { color: var(--text); font-size: 13px; }
.worldmap-tooltip-count b { color: var(--text); font-weight: 800; }

/* Pulsing "blip" markers - jahan se sabse zyada traffic aa raha hai */
.jvm-marker.worldmap-blip {
    transform-box: fill-box;
    transform-origin: center;
    animation: worldmapBlipPulse 1.8s ease-in-out infinite;
}
@keyframes worldmapBlipPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.7); opacity: 0.55; }
}

.worldmap-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.worldmap-legend-chip { display: flex; align-items: center; gap: 6px; background: var(--c-navy-soft); color: var(--c-navy); font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 20px; }
.worldmap-legend-chip b { color: var(--c-orange); font-weight: 800; margin-left: 2px; }
.worldmap-legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-orange); flex-shrink: 0; box-shadow: 0 0 0 3px rgba(249,115,22,0.2); }
.worldmap-legend-empty { color: var(--text-muted); font-size: 13px; }

/* Big number display (Active Users waghera) - consistent size har jagah */
.big-metric-wrap { text-align: center; padding: 8px 0; }
.big-metric-value { font-size: 44px; font-weight: 700; font-family: 'Inter', sans-serif; color: var(--text); line-height: 1.1; }
.big-metric-label { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.device-legend-strip { display: flex; gap: 18px; justify-content: center; margin: 14px 0 8px; font-size: 13px; flex-wrap: wrap; }
.device-bar-track { height: 8px; border-radius: 100px; overflow: hidden; display: flex; background: var(--surface-raised); }
.compact-panel .big-metric-value { font-size: 36px; }
.compact-panel .big-metric-wrap { padding: 4px 0; }

.btn-remove-site {
    background: #FFF6E9; color: var(--danger); border: 1px solid #FFF6E9; border-radius: 6px;
    padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.12s ease;
}
.btn-remove-site:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

table { width: 100%; border-collapse: collapse; min-width: 320px; }
th, td { text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
th { color: var(--text-muted); font-weight: 500; text-transform: uppercase; font-size: 11px; }

.nav-group-toggle { justify-content: space-between; }
.nav-group-toggle .chev { font-size: 10px; color: var(--text-muted); transition: transform 0.15s ease; }
.nav-group.open .nav-group-toggle .chev { transform: rotate(180deg); }
.nav-subitems { display: none; padding: 8px; margin: 0 0 7px; background: var(--surface-raised); border-radius: 10px; }
.nav-group.open .nav-subitems { display: block; }
.nav-subitems .nav-item { font-size: 13px; font-weight: 600; padding: 8px 12px; margin-bottom: 5px; }
.nav-subitems .nav-item:last-child { margin-bottom: 0; }

/* ---------- Sidebar Layout (Dashboard) ---------- */
.app-shell { display: flex; min-height: 100vh; background: var(--bg); padding: 0; gap: 0; }

.sidebar {
    width: 256px; flex-shrink: 0; background: var(--surface); border: none; border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    max-height: 100vh; border-radius: 0; box-shadow: none; z-index: 20;
}
.sidebar .logo { padding: 20px 16px 16px; font-size: 18px; font-weight: 700; background: transparent; border: none; box-shadow: none; border-radius: 0; }
.sidebar-nav { flex: 0 1 auto; padding: 4px 10px; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar-section-label { font-size: 11px; text-transform: none; font-weight: 500; letter-spacing: 0; color: var(--text-muted); padding: 16px 12px 6px; }

.nav-item, .nav-group-toggle {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    padding: 9px 12px; border-radius: 20px; border: none; background: transparent;
    cursor: pointer; color: var(--text); font-size: 14px; font-weight: 400; font-family: 'Inter', sans-serif;
    margin-bottom: 2px; box-shadow: none;
    transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover, .nav-group-toggle:hover { background: var(--surface-raised); box-shadow: none; transform: none; }
.nav-item.active {
    background: var(--amber-soft); color: var(--text); font-weight: 600; border: none;
    box-shadow: none;
}
.nav-item.active .icon-badge { filter: none; opacity: 1; }
.nav-group.open > .nav-group-toggle {
    background: var(--surface-raised); color: var(--text); font-weight: 500; border: none;
    box-shadow: none;
}

/* ---------- Sidebar groups: bilkul flat, koi border/box/shadow - real GA4 jaisa ---------- */
.nav-group-toggle.rt-group-btn,
.nav-group-toggle.audience-group-btn,
.nav-group-toggle.acquisition-group-btn,
.nav-group-toggle.content-group-btn {
    background: transparent !important;
    color: var(--text) !important; font-weight: 400 !important;
    border: none !important;
    box-shadow: none !important;
}
.nav-group.open > .nav-group-toggle.rt-group-btn,
.nav-group.open > .nav-group-toggle.audience-group-btn,
.nav-group.open > .nav-group-toggle.acquisition-group-btn,
.nav-group.open > .nav-group-toggle.content-group-btn {
    background: var(--surface-raised) !important;
    border: none !important; font-weight: 500 !important;
    box-shadow: none !important;
}
.rt-group-btn .icon-badge, .rt-group-btn .chev,
.audience-group-btn .icon-badge, .audience-group-btn .chev,
.acquisition-group-btn .icon-badge, .acquisition-group-btn .chev,
.content-group-btn .icon-badge, .content-group-btn .chev { filter: none !important; opacity: 0.65 !important; color: var(--text-muted) !important; }

.loading-dots span {
    opacity: 0; animation: loadingDotFade 1.4s infinite;
}
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes loadingDotFade {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

.nav-group-toggle.tools-group-btn .icon-badge { filter: none !important; opacity: 1 !important; color: var(--text-muted) !important; }

/* ---------- Addlinemedia logo - halka box ---------- */
.logo-block { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.logo {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'Inter', sans-serif; font-weight: 700; font-size: 20px; color: var(--text);
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    padding: 8px 12px; box-shadow: none;
}

/* Icon badges - flat/minimal, muted-grey so nothing looks like a colorful cartoon emoji strip */
.icon-badge {
    width: 20px; height: 20px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 13px;
    filter: grayscale(1) contrast(1.15); opacity: 0.62;
}
.nav-group-toggle:hover .icon-badge, .nav-item:hover .icon-badge { opacity: 0.85; }


.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }

/* ---------- Workspace switcher - flat white box ---------- */
.workspace-switcher-box {
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: none;
}
.workspace-switcher-box label {
    display: block; color: var(--text-muted); font-weight: 700; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 7px;
}
.workspace-switcher-select {
    width: 100%; padding: 9px 10px; font-size: 13px; font-weight: 600;
    border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text);
    box-shadow: none;
    cursor: pointer;
}
.workspace-switcher-leave {
    display: block; margin-top: 9px; font-size: 11.5px; font-weight: 700;
    color: var(--c-orange); text-decoration: underline; text-align: right; cursor: pointer;
    opacity: 0.9;
}
.workspace-switcher-leave:hover { opacity: 1; }

/* ---------- Sidebar user info + logout - navy/teal 3D box ---------- */
.sidebar-user-box {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: none;
}
.sidebar-user-box .sidebar-user .meta .name { color: var(--text); font-weight: 700; }
.sidebar-user-box .sidebar-user .meta .plan { color: var(--text-muted); font-weight: 700; }
.sidebar-user-box img { border: 2px solid var(--border); }
.sidebar-user-box .logout-link {
    display: block; margin-top: 10px; font-size: 11.5px; font-weight: 700;
    color: var(--c-navy); text-decoration: underline; text-align: right; cursor: pointer; opacity: 0.9;
}
.sidebar-user-box .logout-link:hover { opacity: 1; }

/* ---------- Get App button - lemon/grey 3D box (visible to everyone) ---------- */
.get-app-btn {
    background: var(--surface, #fff) !important;
    color: var(--text) !important;
    font-weight: 600 !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px !important;
    margin-bottom: 6px;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.get-app-btn:hover {
    border-color: var(--c-navy) !important;
    box-shadow: 0 2px 6px rgba(227,116,0,0.12) !important;
}
.get-app-btn .icon-badge { filter: none !important; opacity: 0.75 !important; }
.nav-item.get-app-btn.active {
    background: var(--c-navy) !important;
    color: #fff !important;
    border-color: var(--c-navy) !important;
}
.nav-item.get-app-btn.active .icon-badge { filter: grayscale(1) brightness(0) invert(1) !important; opacity: 0.95 !important; }
.sidebar-user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.sidebar-user img, .sidebar-user .avatar-initials { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.sidebar-user .avatar-initials { display: flex; align-items: center; justify-content: center; background: var(--c-navy); color: #fff; font-weight: 700; font-size: 13px; }
.sidebar-user .meta { flex: 1; overflow: hidden; }
.sidebar-user .meta .name { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .meta .plan { color: var(--text-muted); font-size: 11px; text-transform: uppercase; }

.main-area {
    flex: 1; min-width: 0; background: var(--bg); border-radius: 14px; overflow: hidden;
    display: flex; flex-direction: column;
}
.main-topbar {
    display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 18px 28px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5;
}
.date-range-picker { display: flex; align-items: center; gap: 8px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; }
.date-range-picker input[type="date"] { background: transparent; border: none; color: var(--text); font-size: 13px; padding: 4px; }
.date-presets { display: flex; gap: 6px; }
.date-preset-btn { padding: 6px 12px; font-size: 12px; border-radius: 6px; border: 1px solid var(--border); background: #fff; color: var(--text-muted); cursor: pointer; }
.date-preset-btn.active { background: var(--signal); color: #fff; border-color: var(--signal); font-weight: 600; }

.main-content { padding: 28px; max-width: 100%; overflow-x: hidden; min-width: 0; flex: 1; }
.panel-section { display: none; }
.panel-section.active { display: block; }

.section-title-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.section-title-row h1 { font-size: 22px; color: var(--text); }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #000000; display: inline-block; box-shadow: 0 0 8px #000000; animation: livepulse 1.5s infinite; }
@keyframes livepulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 14px; }

/* ---------- Data table panel (flat, borderless - matches GA4 reference: no
   outer box, no colored header fill, just clean typography + subtle row lines) ---------- */
.table-panel { padding: 0; overflow: hidden; border: none; box-shadow: none; background: transparent; }
.table-panel h2 {
    background: transparent; color: var(--text); margin: 0; padding: 4px 4px 14px;
    font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: none;
}
.table-panel .table-scroll { padding: 0 0 8px; overflow-x: auto; }
.table-panel table { border: none; }
.table-panel table th {
    background: transparent; color: var(--text-muted); font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.03em; padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.table-panel table td { padding: 11px 4px; border-bottom: 1px solid #EFEFEF; font-weight: 500; word-break: break-word; }
#topPagesTable td:first-child { max-width: 320px; }
.table-panel table tr:last-child td { border-bottom: none; }
.table-panel table tr:hover td { background: var(--surface-raised); }

/* Sab category-headers ab ek hi flat style use karte hain - koi alag rang-coded header nahi */
.table-panel.hdr-orange h2, .table-panel.hdr-navy h2 { background: transparent; color: var(--text); }
.table-panel.hdr-orange table th, .table-panel.hdr-navy table th { background: transparent; color: var(--text-muted); }

/* ---------- Table toolbar (entries + search, Publytics style) ---------- */
.table-toolbar {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
    padding: 4px 4px 14px; border-bottom: none;
}
.table-search {
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    padding: 7px 12px; font-size: 12px; color: var(--text); width: 180px;
}

/* ---------- Acquisition tables: flat number cells + totals row (GA4-simple style) ---------- */
.data-box {
    display: inline-block;
    text-align: left;
}
.data-box-value { display: block; font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; }
.data-box-pct { display: block; font-size: 10.5px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }

.totals-row td {
    background: transparent;
    border-bottom: 1px solid var(--border) !important;
    padding-top: 14px; padding-bottom: 14px;
}
.totals-row .data-box-value { color: var(--c-navy); font-size: 15px; }
.totals-row .total-results-label { font-weight: 700; color: var(--c-navy); font-size: 13px; }

/* ---------- Row breakdown (device/browser drill-down) ---------- */
.expand-toggle {
    display: inline-block; width: 14px; cursor: pointer; color: var(--c-navy);
    font-size: 9px; margin-right: 5px; user-select: none;
}
.expand-toggle:hover { color: var(--signal); }
.breakdown-panel {
    padding: 14px 18px; background: var(--surface-raised); border-radius: 8px; margin: 6px 0;
    border: 1px solid var(--border);
}
.rt-source-row:hover { background: var(--c-navy-soft); }

/* Real-Time table "trend arrow" - number upar/neeche jaye to halka sa dim arrow
   dikhta hai, khud fade ho kar gaeb ho jata hai (Publytics jaisa effect) */
.rt-trend-arrow {
    display: inline-block; font-size: 11px; margin-left: 4px;
    animation: rtTrendFade 1.8s ease-out forwards;
}
.rt-trend-up { color: #000000; }
.rt-trend-down { color: #D93025; }
@keyframes rtTrendFade {
    0%   { opacity: 0.85; transform: translateY(0); }
    70%  { opacity: 0.5; }
    100% { opacity: 0; transform: translateY(-2px); }
}
.breakdown-cols { display: flex; gap: 28px; flex-wrap: wrap; }
.breakdown-col { flex: 1; min-width: 180px; }
.breakdown-col-title { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.breakdown-item { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.breakdown-item:last-child { border-bottom: none; }
.breakdown-label { color: var(--text); font-weight: 600; text-transform: capitalize; }
.breakdown-value { color: var(--c-navy); font-weight: 700; white-space: nowrap; }
.breakdown-pct { color: var(--text-muted); font-weight: 500; font-size: 11px; }

/* ---------- Team Admin badge ---------- */
.team-admin-badge {
    display: inline-block; background: linear-gradient(135deg, #FDE047 0%, #FBBF24 100%);
    color: #C97A2E; font-weight: 800; font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
    margin-left: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* ---------- Colored accent borders per category ---------- */
.accent-navy { border-left: 3px solid var(--c-navy) !important; }
.accent-orange { border-left: 3px solid var(--c-orange) !important; }
.accent-red { border-left: 3px solid var(--danger) !important; }

/* ---------- Logo text (simple, static - no animation) ---------- */
.logo .animated-logo {
    color: var(--c-navy);
}

/* ---------- Timeframe / entries dropdown ---------- */
.mini-select {
    background: var(--surface-raised); border: 1px solid var(--border); border-radius: 8px;
    padding: 6px 10px; font-size: 12px; color: var(--text); cursor: pointer;
}

/* ---------- Segmented pill control (Source / Sources+Content / Source+Country) ---------- */
.segmented-control { display: inline-flex; gap: 6px; margin-bottom: 16px; }
.segmented-control button {
    padding: 8px 16px; border-radius: 100px; border: 1px solid var(--border); background: #fff;
    color: var(--text-muted); font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.segmented-control button.active { border-color: var(--signal); color: var(--signal); font-weight: 600; }
.segmented-control button .radio-dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; }
.segmented-control button.active .radio-dot { background: var(--signal); }

/* ---------- Device icon circles ---------- */
.device-icon-circle {
    width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center;
    justify-content: center; color: #fff; font-size: 13px; flex-shrink: 0;
}
.device-legend-row { display: flex; align-items: center; gap: 10px; }
.device-legend-text { font-size: 12px; }
.device-legend-text .pct { font-weight: 700; color: var(--text); display: block; }
.sidebar-backdrop { display: none; }

@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: -260px; top: 10px; bottom: 10px; width: 260px;
        height: auto; max-height: calc(100dvh - 20px);
        border-radius: 14px; transition: left 0.2s ease; box-shadow: 8px 0 24px rgba(0,0,0,0.15);
    }
    .sidebar.open { left: 10px; }
    .sidebar-backdrop.show {
        display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 15;
    }
    .mobile-menu-btn { display: inline-flex !important; }
    .charts-row { grid-template-columns: 1fr; }
    .charts-row-3 { grid-template-columns: 1fr; }
    .hero h1 { font-size: 34px; }
    .nav-links { display: none; }
    .main-content { padding: 18px; }
    .main-topbar { padding: 14px 16px; }

    /* Sidebar items compact taake sab items + logout bina scroll k fit ho jayen */
    .sidebar .logo { padding: 16px 16px 10px; font-size: 16px; }
    .sidebar-nav { padding: 4px 10px; }
    .nav-item, .nav-group-toggle { padding: 8px 10px; margin-bottom: 4px; font-size: 13.5px; }
    .nav-subitems { padding: 6px; margin-bottom: 4px; }
    .nav-subitems .nav-item { padding: 6px 10px; margin-bottom: 3px; font-size: 12.5px; }
    .sidebar-section-label { padding: 10px 10px 5px; }
    .sidebar-footer { padding: 10px 14px; flex-shrink: 0; }
}

.mobile-menu-btn {
    display: none; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
    background: #fff; color: var(--text); font-size: 16px; cursor: pointer;
}

/* ---------- Focus visibility ---------- */
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--signal); outline-offset: 2px;
}

@media (max-width: 700px) {
    .date-preset-btn { padding: 5px 9px; font-size: 11px; }
    #dateControls input[type="date"] { max-width: 118px; font-size: 12px; padding: 5px 6px; }
    #dateControls .btn { padding: 6px 12px; font-size: 12px; }
    .main-topbar { flex-direction: column; align-items: flex-start; }
    #dateControls, #siteSelect { width: 100%; }
    #dateControls { row-gap: 8px; }

    /* Stat boxes (Pageviews/Visitors/Active/Avg. session waghera) - phone pe
       horizontal-scroll wali unequal row ki bajaye ek saaf 2x2 grid, sab boxes
       barabar size k */
    .stats-strip { display: grid; grid-template-columns: 1fr 1fr; overflow-x: visible; }
    .stat-item { min-width: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
    .stat-item:nth-child(2n) { border-right: none; }
    .stat-item:nth-last-child(-n+2) { border-bottom: none; }
}

