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


:root {

    --background: #0d0e10;
    --sidebar: #101114;

    --panel: #15171b;
    --panel-hover: #191b20;

    --border: #272a30;

    --text: #f3f4f6;
    --muted: #858b95;
    --muted-light: #b7bbc2;

    --accent: #ff6b35;

    --success: #4ade80;

    --radius: 14px;
}


body {

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    background: var(--background);

    color: var(--text);

    min-height: 100vh;
}


/* =====================================================
   APP
===================================================== */

.app {

    display: flex;

    min-height: 100vh;
}


/* =====================================================
   SIDEBAR
===================================================== */

.sidebar {

    width: 250px;

    min-height: 100vh;

    background: var(--sidebar);

    border-right: 1px solid var(--border);

    display: flex;

    flex-direction: column;

    padding: 24px 16px;

    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;
}


.brand {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 4px 10px 30px;

    text-decoration: none;

    color: var(--text);
}


.brand-icon {

    width: 42px;
    height: 42px;

    border-radius: 11px;

    background: var(--accent);

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 14px;

    font-weight: 800;
}


.brand-title {

    font-size: 15px;

    font-weight: 700;
}


.brand-subtitle {

    color: var(--muted);

    font-size: 12px;

    margin-top: 2px;
}


.navigation {

    display: flex;

    flex-direction: column;

    gap: 5px;
}


.nav-item {

    display: flex;

    align-items: center;

    gap: 12px;

    padding: 11px 12px;

    border-radius: 9px;

    text-decoration: none;

    color: var(--muted);

    font-size: 14px;

    font-weight: 500;

    transition: 0.15s ease;
}


.nav-item:hover {

    background: var(--panel);

    color: var(--text);
}


.nav-item.active {

    background: rgba(255, 107, 53, 0.12);

    color: var(--accent);
}


.nav-icon {

    width: 20px;

    text-align: center;

    font-size: 17px;
}


.sidebar-bottom {

    margin-top: auto;

    padding: 15px 10px 5px;

    border-top: 1px solid var(--border);
}


.connection {

    display: flex;

    align-items: center;

    gap: 8px;

    color: var(--muted);

    font-size: 12px;
}


.status-dot {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--success);

    box-shadow:
        0 0 8px rgba(74, 222, 128, 0.6);
}


/* =====================================================
   MAIN
===================================================== */

.main {

    margin-left: 250px;

    width: calc(100% - 250px);

    max-width: 1600px;

    padding: 30px 34px 40px;
}


/* =====================================================
   TOPBAR
===================================================== */

.topbar {

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 26px;
}


.page-label {

    color: var(--accent);

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 1.4px;

    margin-bottom: 5px;
}


.topbar h1 {

    font-size: 28px;

    letter-spacing: -0.5px;
}


.header-right {

    display: flex;

    align-items: center;

    gap: 14px;
}


.last-update {

    display: flex;

    flex-direction: column;

    gap: 3px;

    text-align: right;
}


.small-label {

    color: var(--muted);

    font-size: 10px;

    text-transform: uppercase;

    letter-spacing: 0.7px;
}


#last-update {

    color: var(--muted-light);

    font-size: 12px;
}


.refresh-button {

    width: 38px;
    height: 38px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: var(--panel);

    color: var(--muted-light);

    font-size: 20px;

    cursor: pointer;

    transition: 0.2s ease;
}


.refresh-button:hover {

    border-color: var(--accent);

    color: var(--accent);
}


.refresh-button.spinning {

    transform: rotate(360deg);
}


/* =====================================================
   CURRENT CARD
===================================================== */

.current-card {

    background:
        linear-gradient(
            135deg,
            #1b1715,
            #15171b 60%,
            #131519
        );

    border: 1px solid #302824;

    border-radius: var(--radius);

    padding: 25px 28px;

    min-height: 145px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 18px;
}


.current-label {

    display: flex;

    align-items: center;

    gap: 8px;

    color: var(--accent);

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 1px;

    margin-bottom: 13px;
}


.live-dot {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--accent);

    box-shadow:
        0 0 0 4px rgba(255,107,53,0.10),
        0 0 12px rgba(255,107,53,0.55);
}


.current-song {

    font-size: 25px;

    font-weight: 700;

    letter-spacing: -0.5px;
}


.current-artist {

    color: var(--muted-light);

    font-size: 15px;

    margin-top: 5px;
}


.current-time {

    text-align: right;
}


.current-time #current-time {

    font-size: 19px;

    font-weight: 600;

    margin-top: 5px;
}


/* =====================================================
   STATS
===================================================== */

.stats-grid {

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 18px;
}


.stat-card {

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    padding: 20px;

    display: flex;

    align-items: center;

    gap: 15px;

    min-height: 105px;
}


.stat-icon {

    width: 42px;
    height: 42px;

    flex-shrink: 0;

    border-radius: 10px;

    background: rgba(255,107,53,0.1);

    color: var(--accent);

    display: flex;

    align-items: center;

    justify-content: center;
}


.stat-label {

    color: var(--muted);

    font-size: 10px;

    font-weight: 700;

    letter-spacing: 0.7px;

    margin-bottom: 6px;
}


.stat-value {

    font-size: 24px;

    font-weight: 700;
}


.stat-date {

    font-size: 16px;
}


/* =====================================================
   PANELS
===================================================== */

.dashboard-grid {

    display: grid;

    grid-template-columns:
        minmax(0, 1.15fr)
        minmax(0, 0.85fr);

    gap: 18px;

    margin-bottom: 18px;
}


.panel {

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    overflow: hidden;
}


.panel-header {

    padding: 19px 20px;

    border-bottom: 1px solid var(--border);

    display: flex;

    align-items: center;

    justify-content: space-between;
}


.panel-title {

    font-size: 15px;

    font-weight: 700;
}


.panel-subtitle {

    color: var(--muted);

    font-size: 11px;

    margin-top: 4px;
}


.panel-link {

    color: var(--accent);

    font-size: 11px;

    text-decoration: none;
}


.panel-link:hover {

    text-decoration: underline;
}


/* =====================================================
   SONG / ARTIST LIST
===================================================== */

.song-list,
.artist-list,
.recent-list {

    padding: 5px 0;
}


.song-row,
.artist-row,
.recent-row {

    display: flex;

    align-items: center;

    gap: 13px;

    padding: 12px 20px;

    border-bottom:
        1px solid rgba(39,42,48,0.6);
}


.song-row:last-child,
.artist-row:last-child,
.recent-row:last-child {

    border-bottom: none;
}


.song-rank,
.artist-rank {

    width: 22px;

    text-align: center;

    color: var(--muted);

    font-size: 11px;
}


.song-info,
.artist-info,
.recent-info {

    flex: 1;

    min-width: 0;
}


.song-title,
.artist-name,
.recent-title {

    font-size: 13px;

    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.song-artist,
.artist-songs,
.recent-artist {

    color: var(--muted);

    font-size: 11px;

    margin-top: 3px;
}


.song-plays,
.artist-plays {

    color: var(--muted-light);

    font-size: 12px;

    font-weight: 700;
}


.recent-time {

    width: 48px;

    color: var(--muted);

    font-size: 10px;

    flex-shrink: 0;
}


/* =====================================================
   HOURLY SMALL CHART
===================================================== */

.hour-chart {

    height: 270px;

    padding: 25px 20px 18px;

    display: flex;

    align-items: flex-end;

    gap: 7px;
}


.hour-column {

    flex: 1;

    height: 100%;

    display: flex;

    flex-direction: column;

    justify-content: flex-end;

    align-items: center;

    gap: 7px;
}


.hour-bar-area {

    width: 100%;

    height: 205px;

    display: flex;

    align-items: flex-end;

    justify-content: center;
}


.hour-bar {

    width: 100%;

    max-width: 28px;

    min-height: 3px;

    border-radius: 4px 4px 2px 2px;

    background: var(--accent);

    opacity: 0.85;
}


.hour-label {

    color: var(--muted);

    font-size: 9px;
}


/* =====================================================
   PAGE INTRO
===================================================== */

.page-intro {

    margin-bottom: 20px;
}


.page-title {

    font-size: 18px;

    font-weight: 700;
}


.page-description {

    color: var(--muted);

    font-size: 12px;

    margin-top: 5px;
}


/* =====================================================
   FILTERS
===================================================== */

.filters {

    display: flex;

    align-items: flex-end;

    gap: 12px;

    margin-bottom: 18px;

    padding: 16px;

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: var(--radius);
}


.filter-group {

    display: flex;

    flex-direction: column;

    gap: 6px;
}


.filter-group label {

    color: var(--muted);

    font-size: 9px;

    font-weight: 700;

    letter-spacing: 0.8px;
}


select,
.search-box input {

    height: 38px;

    padding: 0 12px;

    background: #101114;

    color: var(--text);

    border: 1px solid var(--border);

    border-radius: 8px;

    outline: none;

    font-size: 12px;
}


select:focus,
.search-box input:focus {

    border-color: var(--accent);
}


.search-box {

    flex: 1;
}


.search-box input {

    width: 100%;
}


/* =====================================================
   TABLE
===================================================== */

.table-container {

    width: 100%;

    overflow-x: auto;
}


table {

    width: 100%;

    border-collapse: collapse;
}


thead {

    background: #111216;
}


th {

    color: var(--muted);

    font-size: 9px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.7px;

    text-align: left;

    padding: 14px 18px;
}


td {

    padding: 15px 18px;

    border-top: 1px solid var(--border);

    font-size: 12px;

    color: var(--muted-light);
}


tbody tr:hover {

    background: rgba(255,255,255,0.015);
}


.rank-cell {

    width: 50px;

    color: var(--muted);
}


.plays-cell {

    color: var(--accent);

    font-weight: 700;
}


.date-cell {

    white-space: nowrap;
}


/* =====================================================
   LARGE HOURLY CHART
===================================================== */

.large-chart-panel {

    margin-bottom: 18px;
}


.large-hour-chart {

    height: 380px;

    padding: 30px 20px 20px;

    display: flex;

    align-items: flex-end;

    gap: 7px;
}


.large-hour-column {

    flex: 1;

    height: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: flex-end;

    gap: 6px;
}


.large-hour-value {

    color: var(--muted);

    font-size: 9px;

    min-height: 11px;
}


.large-hour-bar-area {

    height: 280px;

    width: 100%;

    display: flex;

    align-items: flex-end;

    justify-content: center;
}


.large-hour-bar {

    width: 100%;

    max-width: 32px;

    min-height: 3px;

    background: var(--accent);

    border-radius: 5px 5px 2px 2px;
}


.large-hour-label {

    color: var(--muted);

    font-size: 9px;
}


/* =====================================================
   DAILY CHART
===================================================== */

.daily-chart {

    height: 260px;

    padding: 25px 20px 18px;

    display: flex;

    align-items: flex-end;

    gap: 4px;

    overflow-x: auto;
}


.daily-column {

    min-width: 20px;

    flex: 1;

    height: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: flex-end;

    gap: 7px;
}


.daily-bar {

    width: 100%;

    max-width: 24px;

    min-height: 3px;

    background: var(--accent);

    border-radius: 4px 4px 2px 2px;
}


.daily-label {

    color: var(--muted);

    font-size: 8px;
}


/* =====================================================
   ANALYSIS CARDS
===================================================== */

.analysis-cards {

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;

    margin-bottom: 18px;
}


/* =====================================================
   PAGINATION
===================================================== */

.pagination {

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 15px;

    padding: 16px;

    border-top: 1px solid var(--border);
}


.pagination-button {

    width: 36px;
    height: 36px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: #101114;

    color: var(--muted-light);

    cursor: pointer;
}


.pagination-button:hover:not(:disabled) {

    color: var(--accent);

    border-color: var(--accent);
}


.pagination-button:disabled {

    opacity: 0.35;

    cursor: default;
}


#page-info {

    color: var(--muted);

    font-size: 11px;
}


/* =====================================================
   LOADING
===================================================== */

.loading {

    color: var(--muted);

    font-size: 12px;

    padding: 25px 20px;
}


/* =====================================================
   FOOTER
===================================================== */

.footer {

    display: flex;

    justify-content: space-between;

    color: #5e636c;

    font-size: 10px;

    padding: 8px 2px 0;
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 1000px) {

    .stats-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {

        grid-template-columns: 1fr;
    }

}


@media (max-width: 700px) {

    .app {

        flex-direction: column;
    }


    .sidebar {

        position: static;

        width: 100%;

        min-height: auto;

        border-right: none;

        border-bottom: 1px solid var(--border);

        padding: 15px;
    }


    .brand {

        padding-bottom: 15px;
    }


    .navigation {

        flex-direction: row;

        overflow-x: auto;
    }


    .nav-item {

        flex-shrink: 0;
    }


    .sidebar-bottom {

        display: none;
    }


    .main {

        margin-left: 0;

        width: 100%;

        padding: 22px 15px 30px;
    }


    .topbar {

        align-items: flex-start;
    }


    .topbar h1 {

        font-size: 24px;
    }


    .last-update {

        display: none;
    }


    .current-card {

        min-height: auto;

        padding: 20px;
    }


    .current-song {

        font-size: 20px;
    }


    .current-time {

        display: none;
    }


    .stats-grid,
    .analysis-cards {

        grid-template-columns: 1fr;
    }


    .filters {

        flex-direction: column;

        align-items: stretch;
    }


    .filter-group select {

        width: 100%;
    }


    .hour-chart {

        gap: 3px;
    }


    .hour-bar {

        max-width: 15px;
    }


    .footer {

        flex-direction: column;

        gap: 6px;

        align-items: flex-start;
    }

}
