body {
    font-family: 'Roboto', sans-serif;
    background: #121212;
    color: #e5e5e5;
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 16px;
}

h1, h2 {
    margin: 10px 0;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    line-height: 20px;
}

.topbar {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 9999;
}

#refreshButton {
    background: #1f1f1f;
    border: 1px solid #333;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: bold;
    color: #e5e5e5;
    line-height: 16px;
    cursor: pointer;
}

.theme-selector {
    position: relative;
}

#themeButton {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1f1f1f;
    border: 1px solid #333;
    padding: 6px 10px;
    font-size: 14px;
    color: #e5e5e5;
    cursor: pointer;
    line-height: 16px;
}

#themeButton:hover {
    background: #2a2a2a;
}

.theme-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: #1a1a1a;
    border: 1px solid #333;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    padding: 10px;
    box-sizing: border-box;
}

.theme-options {
    display: flex;
    gap: 8px;
}

.theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 84px;
    background: #242424;
    border: 2px solid transparent;
    color: #e5e5e5;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 4px;
    box-sizing: border-box;
}

.theme-option i {
    font-size: 20px;
}

.theme-option:hover {
    background: #2e2e2e;
}

.theme-option.active {
    border-color: #4a9eff;
}

.theme-option-name {
    font-weight: 600;
}

.theme-option-sub {
    font-size: 11px;
    color: #999;
}

.server-info {
    box-sizing: border-box;
    width: 100%;
    max-width: 300px;
    margin: 12px auto;
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #ccc;
    font-size: 16px;
    line-height: 16px;
    text-align: center;
}

.server-info div {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 3px 0;
}

.server-info a {
    color: #6aa9ff;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.banner-url, .host-connection-link {
    display: block;
    width: 100%;
    text-align: center;
    padding: 4px 0;
}

.banner-url a, .host-connection-link a {
    display: inline-block;
    color: #6aa9ff;
    text-decoration: none;
    white-space: nowrap;
}

.server-info span {
    font-weight: 600;
    color: #bbb;
}

#channels {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.row {
    display: block;
    width: 100%;
    padding: 2px 0;
    box-sizing: border-box;
    white-space: pre-wrap;
    line-height: 16px;
}

.channel {
    color: #ffffff;
    padding-left: 16px;
    line-height: 16px;
}

.client {
    color: #ffffff;
    white-space: normal;
    line-height: 16px;
    position: relative;
    padding-left: 26px;
}

.status-online {
    color: #4CAF50;
    margin-right: 6px;
    font-size: 12px;
    padding-left: 1px;
    padding-right: 0.5px;
}

.status-mic {
    color: #888;
    margin-right: 6px;
    font-size: 12px;
}

.status-mic::before {
    color: #d9534f;
}

.status-audio {
    color: #888;
    margin-right: 6px;
    font-size: 12px;
}

.status-audio::before {
    color: #d9534f;
}

.client-name {
    vertical-align: middle;
}

.row.client .badge,
.row.client .flag {
    margin-left: 6px;
    vertical-align: middle;
}

#onlineTooltip {
    position: fixed;
    background: #2b2b2b;
    color: #ffffff;
    border: 1px solid #4a4a4a;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 99999;
    display: none;
}

.spacer {
    color: #888;
    font-weight: bold;
    width: 100%;
    display: block;
    line-height: 16px;
}

.spacer-mono {
    font-family: "Courier New", monospace;
    overflow: hidden;
    white-space: nowrap;
    line-height: 16px;
}

.spacer-left { text-align: left; }
.spacer-center { text-align: center; }
.spacer-right { text-align: right; }

.blank-spacer {
    height: 16px;
    display: block;
}

.children {
    margin-left: 12px;
}

/* ============================================================
   Stats toggle button (topbar, left of the theme button)
   ============================================================ */
#statsToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f1f1f;
    border: 1px solid #333;
    padding: 6px 10px;
    color: #e5e5e5;
    font-size: 15px;
    cursor: pointer;
    line-height: 16px;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

#statsToggle:hover {
    background: #2a2a2a;
}

#statsToggle.active {
    border-color: #4a9eff;
    color: #4a9eff;
    background: rgba(74, 158, 255, .10);
}

#statsToggle:focus-visible {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
}

/* ============================================================
   Statistics / recent-activity panel
   (same visual language as the app: #1a1a1a, #333, Roboto)
   ============================================================ */
.stats-panel {
    box-sizing: border-box;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 12px;
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    text-align: left;
}

.stats-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 2px 2px 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid #333;
}

.stats-head h2 {
    margin: 0;
    text-align: left;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.stats-head .stats-sub {
    font-size: 12px;
    color: #999;
    font-weight: 400;
    margin-left: 8px;
}

/* Online Clients graph panel (main-page mirror and statistics view) */
.graph-panel {
    box-sizing: border-box;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 12px;
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    text-align: left;
}

/* Inside the statistics view the graph is a section of the card, not a
   standalone signboard */
.stats-panel .graph-panel {
    max-width: none;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
}

/* Section heading (e.g. "Recent Activity") below the graph gets separated */
.stats-panel > .stats-head:not(:first-child) {
    margin-top: 12px;
}

/* Time-range buttons (24h / 7d / 14d / 1m) in the graph and the
   Recent Activity headers */
.graph-ranges,
.activity-ranges {
    display: inline-flex;
    gap: 4px;
}

.graph-range {
    background: #1f1f1f;
    border: 1px solid #333;
    color: #e5e5e5;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    line-height: 16px;
}

.graph-range:hover {
    border-color: #4a9eff;
}

.graph-range.active {
    color: #4a9eff;
    border-color: #4a9eff;
    background: rgba(74, 158, 255, .10);
}

.graph-range:focus-visible {
    outline: 2px solid #4a9eff;
    outline-offset: 2px;
}

/* Online-count graph (line + area fill, TeamSpeak blue) */
.stats-graph-svg {
    display: block;
    width: 100%;
    height: auto;
}

.graph-grid {
    stroke: #2b2b2b;
    stroke-width: 1;
}

.graph-label {
    font-size: 10px;
    font-family: "Roboto", sans-serif;
    fill: #888;
}

.graph-area {
    fill: rgba(3, 112, 219, 0.18);
}

.graph-line {
    fill: none;
    stroke: #0370DB;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.graph-dot {
    fill: #0370DB;
}

/* Hover tooltip: guideline + marker + box with the exact value and time */
.graph-hover-line {
    stroke: #5a5a5a;
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.graph-hover-dot {
    fill: #0370DB;
    stroke: #fff;
    stroke-width: 1.5;
}

.graph-hover-box {
    fill: #262626;
    stroke: #4a4a4a;
    stroke-width: 1;
}

.graph-hover-value {
    font-size: 11px;
    font-weight: 600;
    font-family: "Roboto", sans-serif;
    fill: #e8e8e8;
}

.graph-hover-time {
    font-size: 10px;
    font-family: "Roboto", sans-serif;
    fill: #999;
}

/* Single cell: Name Badges | Country (left-packed group), time flush right */
.stat-grid {
    padding: 8px 2px;
    border-bottom: 1px solid #242424;
}

.stat-grid:last-child {
    border-bottom: none;
}

.stat-cell {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 2px 0;
    min-width: 0;
}

.stat-pipe {
    color: #4a4a4a;
    margin: 0 8px;
    user-select: none;
}

.stat-name {
    font-weight: 600;
    color: #fff;
    margin-right: 8px;
}

/* Status colors on the name (log style): green = online, red = offline. */
.stat-name.online {
    color: #7fd98f;
}

.stat-name.offline {
    color: #ef8080;
}

.stat-none {
    color: #555;
    font-size: 12px;
}

.flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    font-size: 12px;
    margin-right: 6px;
    line-height: 1;
    vertical-align: middle;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 14px;
    white-space: nowrap;
}

.badge i {
    font-size: 9px;
}

.badge.admin {
    color: #4a9eff;
    border-color: #4a9eff;
    background: rgba(74, 158, 255, .10);
}

.badge.vip {
    color: #ffc857;
    border-color: #ffc857;
    background: rgba(255, 200, 87, .10);
}

.badge + .badge {
    margin-left: 6px;
}

.stat-de {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    text-align: right;
    margin-left: auto;
}

.stat-de b {
    color: #ccc;
    font-weight: 600;
}

/* Status colors on the timestamp (green = online, red = offline). */
.stat-de.online {
    color: #58c26e;
}

.stat-de.online b {
    color: #7fd98f;
}

.stat-de.offline {
    color: #e05555;
}

.stat-de.offline b {
    color: #ef8080;
}

@media (min-width: 600px) {
    body {
        font-size: 13px;
    }

    #channels {
        max-width: 800px;
        margin: 0 auto;
    }

    .server-info {
        max-width: 800px;
        font-size: 20px;
    }

    .children {
        margin-left: 20px;
    }
}

@media (max-width: 600px) {
    .server-info {
        max-width: 90%;
        font-size: 16px;
        padding: 10px 14px;
    }

    .server-info div {
        padding: 3px 0;
    }

    .stats-panel {
        max-width: 90%;
        padding: 10px 14px;
    }

    .graph-panel {
        max-width: 90%;
        padding: 10px 14px;
    }

    .stat-de {
        font-size: 11px;
    }
}
.server-info{display:none!important}
