/* =========================================================
   ANALYTICS PANEL
   RoziaGames
   ========================================================= */

:root {
    --bg: #070b16;
    --bg-soft: #0a1020;
    --sidebar: #080d1b;

    --card: #10182c;
    --card-2: #0c1427;

    --border: rgba(100, 125, 200, 0.20);
    --border-strong: rgba(100, 130, 230, 0.32);

    --text: #f5f7ff;
    --muted: #8d9abc;
    --muted-2: #667394;

    --purple: #8257ff;
    --purple-2: #9c43ff;
    --blue: #32b9ff;
    --cyan: #25d4ff;
    --green: #32e89b;
    --red: #ff657d;

    --radius: 18px;
    --radius-sm: 12px;

    --sidebar-width: 240px;

    --shadow:
        0 18px 50px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

html {
    color-scheme: dark;
}

body {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    background:
        radial-gradient(
            circle at 38% 10%,
            rgba(81, 54, 196, 0.12),
            transparent 28%
        ),
        #070b16;

    color: var(--text);
    font-size: 14px;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 4px;
    font-size: 27px;
    line-height: 1.15;
    font-weight: 800;
}

h2 {
    font-size: 22px;
}

h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 750;
}


/* =========================================================
   UTILITIES
   ========================================================= */

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.empty {
    color: var(--muted);
    padding: 18px 4px;
}

.text-link {
    color: #9aa7ff;
    transition: color .18s ease;
}

.text-link:hover {
    color: #c2c9ff;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 30px;
    padding: 0 12px;

    border-radius: 999px;

    border: 1px solid var(--border);

    background:
        rgba(13, 22, 42, .75);

    color: var(--muted);

    font-size: 12px;
}


/* =========================================================
   APP LAYOUT
   ========================================================= */

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;

    width: var(--sidebar-width);

    display: flex;
    flex-direction: column;

    padding: 28px 16px 20px;

    background:
        linear-gradient(
            180deg,
            rgba(8, 13, 28, .99),
            rgba(6, 11, 23, .99)
        );

    border-right:
        1px solid rgba(99, 122, 194, .17);

    z-index: 50;
}

.main {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;

    margin-left: var(--sidebar-width);

    display: flex;
    flex-direction: column;
}


/* =========================================================
   BRAND
   ========================================================= */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 0 8px 30px;

    color: #fff;

    font-size: 22px;
    font-weight: 900;
    letter-spacing: .8px;
}

.brand-mark {
    width: 40px;
    height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background:
        linear-gradient(
            145deg,
            #2fc2ff,
            #8c55ff
        );

    box-shadow:
        0 8px 30px rgba(104, 81, 255, .30);

    color: white;
    font-size: 20px;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav a {
    position: relative;

    display: flex;
    align-items: center;
    gap: 14px;

    min-height: 49px;

    padding: 0 16px;

    border-radius: 13px;

    color: #8d98b8;

    font-size: 15px;
    font-weight: 700;

    transition:
        background .18s ease,
        color .18s ease,
        transform .18s ease;
}

.nav a > span {
    width: 22px;
    text-align: center;

    color: #8c98bb;
}

.nav a:hover {
    color: #fff;

    background:
        rgba(51, 73, 125, .14);
}

.nav a.active {
    color: #fff;

    background:
        linear-gradient(
            90deg,
            rgba(107, 67, 255, .25),
            rgba(29, 87, 145, .22)
        );

    box-shadow:
        inset 0 0 0 1px
        rgba(92, 103, 255, .10);
}

.nav a.active::before {
    content: "";

    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;

    width: 2px;

    border-radius: 10px;

    background:
        linear-gradient(
            #af45ff,
            #5277ff
        );
}

.nav a.active > span {
    color: #8f66ff;
}


/* =========================================================
   SIDEBAR BOTTOM
   ========================================================= */

.sidebar-bottom {
    margin-top: auto;

    display: flex;
    gap: 8px;

    padding-top: 18px;

    border-top:
        1px solid rgba(104, 120, 175, .16);
}

.icon-btn {
    width: 41px;
    height: 41px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    border:
        1px solid rgba(92, 112, 174, .20);

    background:
        rgba(20, 30, 57, .72);

    color: #9ba7c8;

    cursor: pointer;

    transition:
        transform .18s ease,
        border-color .18s ease,
        color .18s ease;
}

.icon-btn:hover {
    transform: translateY(-1px);
    color: #fff;

    border-color:
        rgba(114, 125, 255, .40);
}


/* =========================================================
   TOP BAR
   ========================================================= */

.topbar {
    min-height: 104px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding:
        24px
        clamp(20px, 2.2vw, 34px)
        15px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.live-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 9px rgba(50, 232, 155, .85);
}

.mobile-menu {
    display: none;

    width: 40px;
    height: 40px;

    align-items: center;
    justify-content: center;

    margin-right: 4px;

    border: 0;
    border-radius: 10px;

    background:
        rgba(25, 36, 67, .8);

    color: #fff;
}


/* =========================================================
   CONTENT
   ========================================================= */

.content {
    flex: 1;

    padding:
        0
        clamp(20px, 2.2vw, 34px)
        24px;
}


/* =========================================================
   GENERAL CARD
   ========================================================= */

.card {
    border-radius: var(--radius);

    border:
        1px solid var(--border);

    background:
        linear-gradient(
            145deg,
            rgba(17, 26, 49, .96),
            rgba(10, 17, 33, .96)
        );

    box-shadow:
        var(--shadow);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 14px;
}


/* =========================================================
   KPI
   ========================================================= */

.kpi-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 16px;
}

.kpi {
    min-height: 110px;

    display: flex;
    align-items: center;
    gap: 15px;

    padding: 20px;
}

.kpi-icon {
    width: 50px;
    height: 50px;

    flex: 0 0 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 15px;

    background:
        linear-gradient(
            145deg,
            rgba(110, 78, 255, .30),
            rgba(38, 142, 241, .22)
        );

    color: #eef3ff;

    font-size: 20px;
}

.kpi-value {
    margin-top: 5px;

    font-size: 30px;
    font-weight: 850;
}


/* =========================================================
   GENERIC GRID
   ========================================================= */

.grid-2 {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 16px;

    margin-bottom: 16px;
}

.grid-2 > .card {
    padding: 20px;
}


/* =========================================================
   RANK / OLD LIST SUPPORT
   ========================================================= */

.rank-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.rank-num {
    width: 28px;
    height: 28px;

    flex: 0 0 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background:
        rgba(35, 48, 85, .45);

    color: #aab5d1;
}

.rank-main {
    flex: 1;
    min-width: 0;
}

.rank-title,
.row-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.rank-title {
    color: #f5f7ff;
}

.row-meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.bar {
    height: 6px;

    margin-top: 8px;

    border-radius: 99px;

    overflow: hidden;

    background:
        rgba(52, 66, 108, .24);
}

.bar i {
    display: block;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--purple),
            var(--blue)
        );
}


/* =========================================================
   SIMPLE LIST
   ========================================================= */

.simple-list {
    display: flex;
    flex-direction: column;
}

.simple-list > div:not(.empty) {
    min-height: 44px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    border-bottom:
        1px solid rgba(88, 105, 158, .10);
}

.simple-list > div:last-child {
    border-bottom: 0;
}


/* =========================================================
   LIVE PILL
   ========================================================= */

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 7px 10px;

    border-radius: 999px;

    border:
        1px solid rgba(54, 204, 151, .16);

    background:
        rgba(14, 52, 53, .28);

    color: #d8fff1;

    font-size: 12px;
}

.live-pill > span {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--green);

    box-shadow:
        0 0 8px rgba(50, 232, 155, .8);
}


/* =========================================================
   CHART
   ========================================================= */

.chart-card {
    padding: 20px;

    min-height: 260px;
}

.line-chart {
    position: relative;

    width: 100%;
    min-height: 210px;
}

.legend {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--muted);

    font-size: 12px;
}

.legend-a,
.legend-b {
    width: 8px;
    height: 8px;

    display: inline-block;

    border-radius: 50%;
}

.legend-a {
    background: #8655ff;
}

.legend-b {
    background: #2db9ff;
}


/* =========================================================
   TABLE
   ========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 12px;
    text-align: left;

    border-bottom:
        1px solid rgba(92, 109, 166, .12);
}

th {
    color: #8f9aba;

    font-size: 12px;
    font-weight: 650;
}

td {
    color: #e7ebf7;
}


/* =========================================================
   FORMS
   ========================================================= */

input,
select,
textarea {
    width: 100%;

    min-height: 44px;

    border:
        1px solid rgba(94, 114, 172, .20);

    border-radius: 11px;

    outline: none;

    padding: 0 13px;

    background:
        #10182b;

    color: #f4f7ff;

    transition:
        border-color .18s ease,
        box-shadow .18s ease;
}

textarea {
    min-height: 120px;
    padding: 12px 13px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color:
        rgba(94, 112, 255, .55);

    box-shadow:
        0 0 0 3px
        rgba(95, 83, 255, .08);
}

label {
    display: block;
    margin-bottom: 7px;

    color: #aeb8d4;
    font-size: 13px;
}

button,
.btn {
    min-height: 42px;

    border: 0;

    border-radius: 11px;

    padding: 0 17px;

    background:
        linear-gradient(
            90deg,
            #7d59ff,
            #33b8ff
        );

    color: #fff;

    font-weight: 750;

    cursor: pointer;

    transition:
        transform .18s ease,
        filter .18s ease;
}

button:hover,
.btn:hover {
    filter: brightness(1.07);
}

button:active,
.btn:active {
    transform: translateY(1px);
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    padding: 13px 15px;

    border-radius: 12px;

    margin-bottom: 16px;

    border:
        1px solid rgba(100, 120, 190, .20);
}

.alert-success {
    color: #aaffd8;

    background:
        rgba(20, 100, 72, .20);

    border-color:
        rgba(51, 210, 143, .25);
}

.alert-error {
    color: #ffb3bf;

    background:
        rgba(110, 31, 50, .20);

    border-color:
        rgba(255, 86, 114, .25);
}


/* =========================================================
   LOGIN
   ========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background:
        radial-gradient(
            circle at center,
            rgba(105, 67, 255, .11),
            transparent 35%
        ),
        #070b16;
}

.login-card {
    width: min(450px, 100%);

    padding: 28px;

    border-radius: 22px;

    border:
        1px solid var(--border);

    background:
        linear-gradient(
            145deg,
            rgba(17, 25, 48, .98),
            rgba(9, 15, 30, .98)
        );

    box-shadow:
        0 25px 80px rgba(0, 0, 0, .28);
}


/* =========================================================
   MODERN DASHBOARD - SINGLE SCREEN
   ========================================================= */

.dashboard-screen {
    height: calc(100vh - 120px);

    display: grid;

    grid-template-rows:
        auto
        minmax(0, 1fr)
        minmax(180px, .68fr);

    gap: 14px;

    overflow: hidden;
}


/* =========================================================
   DASHBOARD KPIs
   ========================================================= */

.dashboard-kpis {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;
}

.dashboard-kpi {
    position: relative;

    min-height: 104px;

    display: flex;
    align-items: center;
    gap: 15px;

    padding: 18px;

    overflow: hidden;
}

.dashboard-kpi::before {
    content: "";

    position: absolute;

    width: 180px;
    height: 100px;

    right: -70px;
    top: -40px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(76, 115, 255, .17),
            transparent 70%
        );

    pointer-events: none;
}

.dashboard-kpi::after {
    content: "";

    position: absolute;

    width: 80px;
    height: 3px;

    right: 16px;
    bottom: 17px;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            rgba(137, 72, 255, .12),
            #8f4cff,
            #25bfff
        );

    box-shadow:
        0 0 18px rgba(63, 135, 255, .35);

    opacity: .70;
}

.dashboard-kpi .kpi-value {
    position: relative;
    z-index: 1;

    margin-top: 5px;

    font-size: 29px;
    line-height: 1;

    font-weight: 850;
}

.modern-icon {
    position: relative;
    z-index: 1;

    width: 49px;
    height: 49px;

    min-width: 49px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    background:
        linear-gradient(
            145deg,
            rgba(108, 80, 255, .31),
            rgba(36, 135, 240, .24)
        );

    border:
        1px solid rgba(120, 135, 255, .08);

    box-shadow:
        0 9px 28px rgba(51, 65, 180, .18);

    color: #f4f6ff;
}


/* =========================================================
   DASHBOARD MIDDLE
   ========================================================= */

.dashboard-middle {
    min-height: 0;

    display: grid;

    grid-template-columns:
        minmax(0, 1.18fr)
        minmax(0, .82fr);

    gap: 14px;
}

.dashboard-panel {
    min-height: 0;

    padding: 18px;

    overflow: hidden;
}


/* =========================================================
   COUNTRIES
   ========================================================= */

.country-ranking {
    display: flex;
    flex-direction: column;

    gap: 7px;

    margin-top: 5px;
}

.country-row {
    min-height: 47px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 3px 0;
}

.country-rank {
    width: 32px;
    height: 32px;

    min-width: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background:
        linear-gradient(
            145deg,
            rgba(50, 68, 120, .72),
            rgba(22, 30, 56, .88)
        );

    border:
        1px solid rgba(110, 127, 195, .14);

    color: #dbe2fb;

    font-weight: 750;

    font-size: 13px;
}

.country-main {
    flex: 1;
    min-width: 0;
}

.country-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 7px;
}

.country-top span {
    min-width: 0;

    overflow: visible;
    overflow-wrap: anywhere;
    white-space: normal;

    color: #eef2ff;

    font-weight: 650;
}

.country-top strong {
    color: #fff;

    font-size: 14px;
}

.country-bar {
    width: 100%;
    height: 7px;

    overflow: hidden;

    border-radius: 100px;

    background:
        rgba(60, 76, 123, .22);
}

.country-bar i {
    display: block;

    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #8955ff,
            #30c1ff
        );

    box-shadow:
        0 0 17px rgba(70, 140, 255, .34);
}


/* =========================================================
   LIVE PANEL
   ========================================================= */

.live-panel {
    display: flex;
    flex-direction: column;
}

.live-player-center {
    min-height: 0;
    flex: 1;

    display: flex;
    align-items: center;
    justify-content: center;
}

.live-ring {
    position: relative;

    width: 162px;
    height: 162px;

    border-radius: 50%;

    padding: 7px;

    box-shadow:
        0 0 36px rgba(73, 86, 255, .17);
}

.live-ring-neon {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
    background:
        conic-gradient(
            #31c8ff 0deg,
            #7056ff 220deg,
            rgba(45, 57, 93, .22) 220deg
        );

}

.live-ring.is-active .live-ring-neon {
    animation: live-neon-spin 6s linear infinite;
}

@keyframes live-neon-spin {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(150deg); }
    50% { transform: rotate(180deg); }
    75% { transform: rotate(330deg); }
    100% { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .live-ring.is-active .live-ring-neon { animation: none; }
}

.live-ring::before,
.live-ring::after {
    content: "";
    pointer-events: none;
    animation: live-ring-pulse 3s ease-in-out infinite;

    position: absolute;

    inset: -17px;

    border-radius: 50%;

    border:
        1px solid rgba(100, 111, 255, .40);
}

.live-ring::after {
    animation-delay: 0s;
    inset: -34px;

    border-color:
        rgba(64, 121, 255, .32);
}

@keyframes live-ring-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: .45; }
}

@media (prefers-reduced-motion: reduce) {
    .live-ring::before,
    .live-ring::after { animation: none; }
}

.live-ring-inner {
    position: relative;
    z-index: 2;

    width: 100%;
    height: 100%;

    border-radius: 50%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle,
            #182344 0%,
            #0d1529 67%
        );

    border:
        1px solid rgba(109, 128, 211, .10);
}

.live-user-icon {
    color: #8063ff;

    font-size: 22px;

    text-shadow:
        0 0 16px rgba(119, 77, 255, .55);
}

.live-ring strong {
    margin: 0;

    font-size: 35px;
    line-height: 1;

    font-weight: 850;
}

.live-ring span {
    color: #99a7c9;

    font-size: 11px;
}

.live-country-list {
    margin-top: 4px;

    max-height: 90px;

    overflow-y: auto;
}

.live-country-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 6px 4px;

    color: #cdd4ea;

    font-size: 12px;
}

.live-country-row strong {
    color: #fff;
}


/* =========================================================
   DASHBOARD BOTTOM CHART
   ========================================================= */

.dashboard-chart {
    min-height: 0;

    padding: 15px 18px;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.dashboard-chart .card-head {
    margin-bottom: 4px;
}

.dashboard-line-chart {
    min-height: 0;
    flex: 1;
}


/* =========================================================
   DASHBOARD CARDS
   ========================================================= */

.dashboard-screen .card {
    background:
        radial-gradient(
            circle at 85% 0%,
            rgba(41, 89, 175, .08),
            transparent 37%
        ),
        linear-gradient(
            145deg,
            rgba(18, 27, 51, .98),
            rgba(10, 17, 34, .98)
        );

    border:
        1px solid rgba(75, 104, 185, .24);

    box-shadow:
        0 15px 45px rgba(0, 0, 0, .13);
}


/* =========================================================
   DESKTOP HEIGHT OPTIMIZATION
   Genel Bakış tek ekrana sığsın
   ========================================================= */

@media (min-width: 1100px) and (max-height: 1000px) {

    .topbar {
        min-height: 86px;

        padding-top: 16px;
        padding-bottom: 10px;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .content {
        padding-bottom: 12px;
    }

    .dashboard-screen {
        height: calc(100vh - 98px);

        gap: 11px;

        grid-template-rows:
            auto
            minmax(0, 1fr)
            minmax(155px, .62fr);
    }

    .dashboard-kpis {
        gap: 11px;
    }

    .dashboard-kpi {
        min-height: 82px;

        padding: 12px 15px;
    }

    .dashboard-kpi .kpi-value {
        font-size: 25px;
    }

    .dashboard-kpi::after {
        bottom: 12px;
    }

    .modern-icon {
        width: 43px;
        height: 43px;

        min-width: 43px;
    }

    .dashboard-middle {
        gap: 11px;
    }

    .dashboard-panel {
        padding: 14px 16px;
    }

    .dashboard-panel .card-head {
        margin-bottom: 5px;
    }

    .country-ranking {
        gap: 2px;
    }

    .country-row {
        min-height: 39px;
        padding: 1px 0;
    }

    .country-rank {
        width: 29px;
        height: 29px;

        min-width: 29px;
    }

    .country-top {
        margin-bottom: 5px;
    }

    .country-bar {
        height: 6px;
    }

    .live-ring {
        width: 132px;
        height: 132px;
    }

    .live-ring strong {
        font-size: 30px;
    }

    .dashboard-chart {
        padding:
            11px
            16px
            9px;
    }
}


/* =========================================================
   SHORT DESKTOP
   ========================================================= */

@media (min-width: 1100px) and (max-height: 820px) {

    .topbar {
        min-height: 76px;
    }

    .dashboard-screen {
        height: calc(100vh - 84px);

        grid-template-rows:
            74px
            minmax(0, 1fr)
            145px;
    }

    .dashboard-kpi {
        min-height: 74px;
    }

    .dashboard-kpi .muted {
        font-size: 12px;
    }

    .dashboard-kpi .kpi-value {
        font-size: 23px;
    }

    .modern-icon {
        width: 39px;
        height: 39px;

        min-width: 39px;
    }

    .country-row {
        min-height: 34px;
    }

    .live-ring {
        width: 115px;
        height: 115px;
    }

    .live-ring strong {
        font-size: 27px;
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1050px) {

    :root {
        --sidebar-width: 210px;
    }

    .dashboard-screen {
        height: auto;

        display: block;

        overflow: visible;
    }

    .dashboard-kpis {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dashboard-middle {
        grid-template-columns: 1fr;

        margin-top: 14px;
    }

    .dashboard-chart {
        min-height: 300px;

        margin-top: 14px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   MOBILE SIDEBAR
   ========================================================= */

@media (max-width: 760px) {

    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        width: 235px;

        transform: translateX(-105%);

        transition:
            transform .22s ease;

        box-shadow:
            20px 0 60px rgba(0, 0, 0, .35);
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    .main {
        width: 100%;
        margin-left: 0;
    }

    .mobile-menu {
        display: inline-flex;
    }

    .topbar {
        min-height: 82px;

        justify-content: flex-start;

        padding:
            14px
            16px
            10px;
    }

    .top-actions {
        margin-left: auto;
    }

    .content {
        padding:
            0
            14px
            18px;
    }

    h1 {
        font-size: 22px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {

    .dashboard-kpis,
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi,
    .kpi {
        min-height: 84px;
    }

    .dashboard-middle {
        display: block;
    }

    .dashboard-panel {
        margin-bottom: 14px;
    }

    .live-player-center {
        min-height: 210px;
    }

    .dashboard-chart {
        min-height: 280px;
    }

    .card-head {
        align-items: flex-start;
    }

    .legend {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background:
        rgba(8, 13, 27, .45);
}

::-webkit-scrollbar-thumb {
    border-radius: 10px;

    background:
        rgba(79, 97, 151, .42);
}

::-webkit-scrollbar-thumb:hover {
    background:
        rgba(97, 117, 181, .58);
}
/* Kartın çerçevesi ve iki yüzü birlikte döner. */
.live-flip-card { position: relative; padding: 0; perspective: 1100px; overflow: visible; background: transparent; border: 0; box-shadow: none; touch-action: pan-y; cursor: grab; min-height: 320px; }
.live-flip-card:active { cursor: grabbing; }
.live-flip-card:focus-visible { outline: 2px solid #31c8ff; outline-offset: 3px; border-radius: var(--radius); }
.live-flip-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.22,.8,.25,1); }
.live-flip-card .live-flip-inner { transform: rotateY(var(--live-flip-angle, 0deg)); }
.live-flip-face { position: absolute; inset: 0; padding: 15px 17px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; overflow: hidden; }
.live-flip-front { user-select: none; }
.live-flip-back { transform: rotateY(180deg); }
.live-flip-back .live-country-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0; }
.live-flip-back .live-country-row { padding: 11px 4px; border-bottom: 1px solid rgba(100,111,255,.16); }
.live-flip-back .live-country-row span { overflow-wrap: anywhere; }
.live-flip-back .live-country-row strong { flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) { .live-flip-inner { transition: none; } }

.history-content { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 4px 0 0; }
.history-install { border: 1px solid rgba(80,127,255,.3); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; background: rgba(27,43,77,.24); }
.history-install-label { color: #cdd8f4; font-size: 14px; font-weight: 700; }
.history-install-total { display: flex; align-items: center; gap: 12px; margin: 5px 0; }
.history-install-total>strong { font-size: 34px; line-height: 1.2; color: #fff; }
.history-install small { display: block; margin-top: 4px; color: #94a8cf; font-size: 11px; }
.history-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.history-section { min-width: 0; border: 1px solid rgba(80,127,255,.24); border-radius: 14px; padding: 12px; }
.history-section h4 { margin: 0 0 10px; color: #eef2ff; font-size: 15px; }
.history-row { padding: 13px 0; border-bottom: 1px solid rgba(80,127,255,.12); }
.history-row:last-child { border-bottom: 0; }
.history-row-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #cdd8ef; font-size: 12px; }
.history-row-values { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.history-row-values strong { color: #fff; font-size: 16px; }
.history-delta { display: inline-flex; padding: 3px 6px; border-radius: 7px; font-size: 11px; font-weight: 700; }
.history-delta.positive { color: #35e2a0; background: rgba(23,180,124,.14); }
.history-delta.negative { color: #ff8c9e; background: rgba(255,90,120,.13); }
.history-delta.neutral { color: #9bb0d8; background: rgba(120,145,190,.12); }
.history-unavailable { color: #899abb; font-size: 9px; }
.history-row small { display: block; color: #899abb; font-size: 9px; margin: 4px 0 6px; }
.history-note { font-size: 10px; color: #899abb; line-height: 1.6; margin: 12px 0 0; }
.history-flip-card .live-flip-front>.country-ranking { overflow-y: auto; min-height: 0; }
@media(max-width: 600px) { .history-columns { grid-template-columns: 1fr; } }

.history-row .country-bar { margin-top: 8px; }
.history-column { min-width: 0; }
.history-column-title { margin: 0 0 18px; color: #eef2ff; font-size: 18px; font-weight: 750; line-height: 1.35; }
.history-flip-card .history-content { padding-top: 0; }

/* Her geçmiş dönem ayrı kart; içerik üst ve alt kenarlara eşit uzaklıkta. */
.history-flip-card .history-content { display: flex; flex-direction: column; padding: 0; }
.history-columns { flex: 1; }
.history-column { display: flex; flex-direction: column; }
.history-section { display: grid; grid-template-rows: repeat(6, minmax(56px, 1fr)); gap: 8px; flex: 1; padding: 0; border: 0; border-radius: 0; }
.history-row { display: flex; flex-direction: column; justify-content: center; padding: 12px 14px; border: 1px solid rgba(80,127,255,.24); border-radius: 12px; background: rgba(17,26,49,.5); }
.history-row:last-child { border-bottom: 1px solid rgba(80,127,255,.24); }

.live-day-host { padding: 0; overflow: visible; transform-style: preserve-3d; }
.live-day-inner { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--live-day-angle, 0deg)); transition: transform .7s cubic-bezier(.22,.8,.25,1); }
.live-day-face { position: absolute; inset: 0; padding: 15px 17px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.live-day-summary { transform: rotateX(180deg); }
.live-flip-card[data-live-day-flip].is-flipped { touch-action: none; }
@media(prefers-reduced-motion: reduce) { .live-day-inner { transition: none; } }

/* İç içe 3B yüzlerin kapalı karttan sızmasını önler. */
.live-flip-card[data-live-day-flip]:not(.is-flipped) .live-flip-back,
.live-flip-card[data-live-day-flip]:not(.is-flipped) .live-day-face { visibility: hidden; }
.live-flip-card[data-live-day-flip].is-flipped .live-flip-front { visibility: hidden; }
.live-flip-card[data-live-day-flip].is-flipped .live-flip-back { visibility: visible; }
.live-flip-card[data-live-day-flip].is-flipped:not(.is-daily) .live-day-instant { visibility: visible; }
.live-flip-card[data-live-day-flip].is-flipped:not(.is-daily) .live-day-summary { visibility: hidden; }
.live-flip-card[data-live-day-flip].is-flipped.is-daily .live-day-instant { visibility: hidden; }
.live-flip-card[data-live-day-flip].is-flipped.is-daily .live-day-summary { visibility: visible; }

.dashboard-kpi.kpi-flip { padding: 0; overflow: visible; background: transparent; border: 0; box-shadow: none; perspective: 1100px; cursor: pointer; }
.dashboard-kpi.kpi-flip::before, .dashboard-kpi.kpi-flip::after { content: none; }
.kpi-flip-inner { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(var(--kpi-flip-angle, 0deg)); transition: transform .7s cubic-bezier(.22,.8,.25,1); }
.kpi-flip .kpi-flip-face { position: absolute; inset: 0; height: 100%; min-height: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.kpi-flip-yesterday { transform: rotateY(180deg); }
.kpi-flip:focus-visible { outline: 2px solid #31c8ff; outline-offset: 3px; border-radius: var(--radius); }
@media(prefers-reduced-motion: reduce) { .kpi-flip-inner { transition: none; } }

/* Navigation is now inside the chart instead of the sidebar. */
body .app-shell .main { width: 100%; margin-left: 0; }
.chart-navigation { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; width: 100%; }
.chart-navigation a,.chart-navigation button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 12px; border: 1px solid rgba(111,132,221,.24); border-radius: 14px; background: linear-gradient(135deg,rgba(111,78,255,.15),rgba(29,109,192,.12)); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.chart-navigation a:hover,.chart-navigation button:hover,.chart-navigation a.active { border-color: #8655ff; background-color: rgba(111,78,255,.16); }
.chart-navigation span { font-size: 22px; }
.content > .chart-navigation { margin-bottom: 20px; }
@media(max-width:600px) { .chart-navigation { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } .chart-navigation a,.chart-navigation button { min-height:44px; padding:8px; } }

.dashboard-chart.chart-flip { position: relative; padding: 0; background: transparent; border: 0; overflow: visible; perspective: 1100px; touch-action: pan-x; }
.chart-flip-inner { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--chart-flip-angle,0deg)); transition: transform .7s cubic-bezier(.22,.8,.25,1); }
.chart-flip .chart-flip-face { position: absolute; inset:0; height:100%; backface-visibility:hidden; -webkit-backface-visibility:hidden; }
.chart-flip-back { transform: rotateX(180deg); justify-content:center; }
.chart-flip:focus-visible { outline:2px solid #31c8ff; outline-offset:3px; border-radius:var(--radius); }
@media(prefers-reduced-motion:reduce) { .chart-flip-inner { transition:none; } }

/* Keep equal outer spacing after removing the sidebar navigation. */
.dashboard-page .content { padding-top: 18px; padding-bottom: 18px; }
@media (min-width:1100px) { .dashboard-page .dashboard-screen { height:calc(100vh - 36px); height:calc(100dvh - 36px); } }
@media (min-width:769px) and (max-width:1099px) { .dashboard-page .dashboard-screen { min-height:calc(100vh - 36px); min-height:calc(100dvh - 36px); } }

/* Five equal KPI cards including AdMob earnings. */
@media (min-width:1100px) { .dashboard-kpis { grid-template-columns: repeat(5,minmax(0,1fr)); } }
