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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #222;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #999;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
}

.status-dot.connected {
    background: #4caf50;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.stat-card h3 {
    font-size: 0.8rem;
    color: #999;
    font-weight: 400;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #222;
}

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover { color: #333; }
.tab-btn.active { color: #222; border-bottom-color: #222; }

.tab-content { padding: 15px 0; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.tab-pane h3 { font-size: 1rem; font-weight: 600; margin-bottom: 15px; color: #333; }

.chart-container { position: relative; height: 280px; margin: 15px 0; }

.player-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }

.player-card { padding: 12px; border: 1px solid #eee; border-radius: 4px; }
.player-card .username { font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; color: #222; }
.player-card .info { font-size: 0.8rem; color: #999; margin-bottom: 2px; }

.stats-table { overflow-x: auto; margin: 15px 0; }
.stats-table table { width: 100%; border-collapse: collapse; }
.stats-table th, .stats-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eee; font-size: 0.85rem; }
.stats-table th { font-weight: 600; color: #666; background: #fafafa; }
.stats-table tr:hover { background: #fafafa; }

.date-selector { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; font-size: 0.9rem; }
.date-selector label { color: #666; }
.date-selector input, .date-selector select { padding: 6px 10px; border: 1px solid #ddd; border-radius: 4px; background: #fff; color: #333; font-size: 0.85rem; }

.toolbar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.server-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.server-selector label {
    font-size: 0.85rem;
    color: #666;
}

.server-selector select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 0.85rem;
    min-width: 150px;
}

.node-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.node-stat-card {
    padding: 12px;
    border: 1px solid #eee;
    border-radius: 4px;
    border-left: 3px solid #ccc;
}

.node-stat-card.online { border-left-color: #4caf50; }
.node-stat-card.offline { border-left-color: #ff4757; }
.node-stat-card.error { border-left-color: #ffa502; }

.node-stat-card .node-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.node-stat-card .node-info {
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 2px;
}

.admin-auth {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

.admin-auth input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 8px;
    width: 200px;
}

.admin-auth button {
    padding: 8px 16px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.admin-auth button:hover { background: #555; }

code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
}

.motd-section {
    background: #fafafa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.motd-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.motd-row label {
    min-width: 280px;
    font-size: 0.85rem;
    color: #666;
    padding-top: 6px;
}

.motd-row textarea {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    resize: vertical;
    min-width: 300px;
}

.motd-row input[type="file"] {
    max-width: 200px;
}

.motd-row button, .motd-row span {
    white-space: nowrap;
}

#remoteInfo {
    color: #666;
    font-size: 0.85rem;
}

.server-tabs {
    margin-bottom: 15px;
}

.server-tabs > div {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.server-tab {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #666;
    cursor: pointer;
    font-size: 0.85rem;
}

.server-tab:hover { background: #f5f5f5; }
.server-tab.active { background: #333; color: #fff; border-color: #333; }
.server-tab.disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 768px) {
    .container { padding: 10px; }
    header { flex-direction: column; gap: 10px; }
    .stats-overview { grid-template-columns: 1fr 1fr; }
}
