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

:root {
    --bg: #0d0f12;
    --surface: #161b22;
    --surface2: #1e242d;
    --border: #2d3748;
    --text: #e2e8f0;
    --muted: #718096;
    --online: #48bb78;
    --offline: #fc8181;
    --unknown: #ecc94b;
    --primary: #667eea;
    --warning: #ed8936;
    --danger: #e53e3e;
    --success: #48bb78;
    --accent: #764ba2;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
}

.header-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
}
.header-title .fa-skull { color: var(--accent); }

.build-tag {
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--muted);
    font-size: 13px;
}

.btn-logout {
    color: var(--muted);
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s;
}
.btn-logout:hover { color: var(--text); border-color: var(--text); }

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── GRIDS ───────────────────────────────────────────────────────────────────── */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.events-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* ── CARD ────────────────────────────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.card-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.card-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-hdr .card-label { margin-bottom: 0; }

/* ── STATUS ──────────────────────────────────────────────────────────────────── */

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}
.status-dot.online  { background: var(--online);  animation: pulse-online 2s infinite; }
.status-dot.offline { background: var(--offline); }
.status-dot.unknown { background: var(--unknown); }
.status-dot.restarting {
    background: var(--warning);
    animation: pulse-restarting 1s infinite;
}

@keyframes pulse-online {
    0%   { box-shadow: 0 0 0 0 rgba(72,187,120,0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(72,187,120,0); }
    100% { box-shadow: 0 0 0 0 rgba(72,187,120,0); }
}
@keyframes pulse-restarting {
    0%   { box-shadow: 0 0 0 0 rgba(237,137,54,0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(237,137,54,0); }
    100% { box-shadow: 0 0 0 0 rgba(237,137,54,0); }
}

.status-text {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 2px;
}
.status-text.online  { color: var(--online); }
.status-text.offline { color: var(--offline); }
.status-text.unknown { color: var(--unknown); }

.status-uptime {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 16px;
    padding-left: 26px;
}

.server-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.meta-item {
    color: var(--muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.meta-item i { width: 14px; color: var(--primary); }

/* ── BUTTONS ─────────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #5a67d8; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #dd6b20; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c53030; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #38a169; }

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--surface2); }

.btn-danger-outline {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}
.btn-danger-outline:hover { background: rgba(229,62,62,0.1); }

.btn-sm { padding: 7px 12px; font-size: 13px; }

.btn-lookup {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.btn-lookup:hover { border-color: var(--primary); color: var(--primary); }

.btn-console {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-console:hover { background: var(--surface); border-color: var(--primary); color: var(--primary); }

/* ── ACTION CARDS (Dashboard Server Control) ─────────────────────────────────── */

.action-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.action-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.18s;
    text-align: left;
    color: var(--text);
    width: 100%;
}
.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.action-card:active { transform: translateY(0); }

.ac-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.18s;
}
.ac-content { flex: 1; min-width: 0; }
.ac-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 3px;
    line-height: 1.2;
}
.ac-desc {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.35;
}

.action-start   { border-left: 3px solid var(--success); }
.action-start .ac-icon { background: rgba(72,187,120,0.12); color: var(--success); }
.action-start:hover { border-color: var(--success); background: rgba(72,187,120,0.05); }

.action-restart { border-left: 3px solid var(--warning); }
.action-restart .ac-icon { background: rgba(237,137,54,0.12); color: var(--warning); }
.action-restart:hover { border-color: var(--warning); background: rgba(237,137,54,0.05); }

.action-stop    { border-left: 3px solid var(--offline); }
.action-stop .ac-icon { background: rgba(252,129,129,0.1); color: var(--offline); }
.action-stop:hover { border-color: var(--offline); background: rgba(252,129,129,0.04); }

.action-save    { border-left: 3px solid var(--primary); }
.action-save .ac-icon { background: rgba(102,126,234,0.12); color: var(--primary); }
.action-save:hover { border-color: var(--primary); background: rgba(102,126,234,0.05); }

.action-sched   { border-left: 3px solid var(--muted); }
.action-sched .ac-icon { background: rgba(113,128,150,0.12); color: var(--muted); }
.action-sched:hover { border-color: var(--text); background: rgba(113,128,150,0.06); }
.action-sched:hover .ac-icon { color: var(--text); }

.action-wipe    { border-left: 3px solid var(--danger); }
.action-wipe .ac-icon { background: rgba(229,62,62,0.1); color: var(--danger); }
.action-wipe:hover { border-color: var(--danger); background: rgba(229,62,62,0.05); }

.action-status {
    font-size: 13px;
    min-height: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.action-status.loading { color: var(--muted); }
.action-status.success { color: var(--success); }
.action-status.error   { color: var(--offline); }

/* ── NAV BAR RIGHT SECTION ───────────────────────────────────────────────────── */

.tab-bar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
}

.nav-status-mini {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nav-status-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--muted);
    white-space: nowrap;
}
.nav-st-online  { color: var(--online); }
.nav-st-offline { color: var(--offline); }
.nav-st-unknown { color: var(--unknown); }

.btn-nav-action {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.18s;
    white-space: nowrap;
}
.btn-nav-restart:hover { border-color: var(--warning); color: var(--warning); background: rgba(237,137,54,0.08); }
.btn-nav-save:hover    { border-color: var(--primary);  color: var(--primary);  background: rgba(102,126,234,0.08); }

/* ── BUTTON DATA-TIP TOOLTIPS ────────────────────────────────────────────────── */

.btn[data-tip],
.action-card[data-tip],
.btn-reset-default[data-tip] {
    position: relative;
}
.btn[data-tip]::after,
.action-card[data-tip]::after,
.btn-reset-default[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a202c;
    border: 1px solid var(--border);
    color: #e2e8f0;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0;
    white-space: nowrap;
    max-width: 220px;
    width: max-content;
    z-index: 500;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.5);
    text-align: center;
}
.btn[data-tip]:hover::after,
.action-card[data-tip]:hover::after,
.btn-reset-default[data-tip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ── DASHBOARD PLAYERS MINI ──────────────────────────────────────────────────── */

.online-big-count {
    font-size: 34px;
    font-weight: 700;
    color: var(--online);
    line-height: 1;
    margin-bottom: 12px;
}

.dash-player-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-height: 48px;
    flex: 1;
}

.dash-player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
    padding: 4px 0;
}
.dash-player-item .player-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dash-player-item.offline { color: var(--muted); }

.dash-players-btn {
    width: 100%;
    justify-content: center;
    margin-top: 14px;
}

/* ── DRAG & DROP ─────────────────────────────────────────────────────────────── */

.drag-handle {
    color: var(--muted);
    cursor: grab;
    padding: 0 10px 0 0;
    flex-shrink: 0;
    font-size: 13px;
    display: flex;
    align-items: center;
}
.drag-handle:hover { color: var(--text); }
.drag-handle:active { cursor: grabbing; }
.drag-handle-spacer { width: 23px; flex-shrink: 0; }

.mod-item[draggable="true"] { cursor: default; }
.mod-item.dragging { opacity: 0.35; border-style: dashed; }
.mod-item.drag-over { border-color: var(--primary); background: rgba(102,126,234,0.12); }
.mod-item-locked { opacity: 0.65; }

.map-lock-icon {
    color: var(--muted);
    font-size: 12px;
    flex-shrink: 0;
    padding: 4px 6px;
}

/* ── MOD MANAGER ─────────────────────────────────────────────────────────────── */

.mod-manager-inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mod-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 600;
}
.mod-hint { font-size: 12px; color: var(--muted); font-weight: 400; }

.mod-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 48px;
}

.mod-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mod-item-ids {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mod-workshop-id {
    color: var(--muted);
    font-size: 12px;
    font-family: monospace;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mod-id-tag {
    background: rgba(102,126,234,0.15);
    color: var(--primary);
    border: 1px solid rgba(102,126,234,0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    font-weight: 600;
}

.mod-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.mod-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mod-updated {
    color: var(--muted);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.mod-updated i { color: var(--primary); font-size: 10px; }

.btn-remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.btn-remove:hover { background: rgba(229,62,62,0.15); color: var(--offline); }

.mod-empty {
    text-align: center;
    color: var(--muted);
    padding: 28px;
    font-size: 13px;
    line-height: 2;
}
.mod-empty.error { color: var(--offline); }

.add-mod-section { border-top: 1px solid var(--border); padding-top: 20px; }
.add-mod-title {
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.add-mod-title i { color: var(--primary); }
.add-mod-form { display: flex; flex-direction: column; gap: 12px; }

.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.label-hint { text-transform: none; font-weight: 400; font-size: 11px; }
.input-with-btn { display: flex; gap: 8px; }

.mod-footer {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dirty-banner, .restart-reminder {
    width: 100%;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dirty-banner {
    background: rgba(237,137,54,0.1);
    border: 1px solid rgba(237,137,54,0.3);
    color: var(--warning);
}
.restart-reminder {
    background: rgba(102,126,234,0.1);
    border: 1px solid rgba(102,126,234,0.3);
    color: var(--primary);
}
.restart-note {
    color: var(--muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── LARGER MOD THUMBNAILS (Mods tab) ────────────────────────────────────────── */

.mod-list-lg .mod-item { padding: 12px 14px; }

.mod-thumb-wrap {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 7px;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mod-thumb {
    width: 46px;
    height: 46px;
    object-fit: cover;
    display: block;
}
.mod-thumb-icon { color: var(--muted); font-size: 18px; opacity: 0.5; }

.mod-list-lg .mod-thumb-wrap {
    width: 72px;
    height: 72px;
    border-radius: 10px;
}
.mod-list-lg .mod-thumb {
    width: 72px;
    height: 72px;
}
.mod-list-lg .mod-thumb-icon { font-size: 26px; }
.mod-list-lg .mod-title { font-size: 14px; }

/* ── SUB-TABS (Mods card) ────────────────────────────────────────────────────── */

.mods-card { padding-bottom: 0; }

.sub-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin: 12px -20px 0;
    padding: 0 20px;
}

.sub-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}
.sub-tab-btn:hover { color: var(--text); }
.sub-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.sub-tab-btn i { font-size: 11px; }

.mod-subtab { padding-top: 20px; }

/* ── CONFLICTS ───────────────────────────────────────────────────────────────── */

.conflicts-intro {
    padding: 8px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.conflicts-intro p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}

#conflicts-result { margin-top: 4px; }

.conflict-summary {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.conflict-summary.clean {
    background: rgba(72,187,120,0.1);
    border: 1px solid rgba(72,187,120,0.25);
    color: var(--success);
}
.conflict-summary.has-issues {
    background: rgba(229,62,62,0.08);
    border: 1px solid rgba(229,62,62,0.25);
    color: var(--offline);
}

.conflict-item {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.conflict-sev {
    flex-shrink: 0;
    width: 60px;
    text-align: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    align-self: flex-start;
    margin-top: 2px;
}
.conflict-sev.high   { background: rgba(229,62,62,0.2);   color: #fc8181; border: 1px solid rgba(229,62,62,0.4); }
.conflict-sev.medium { background: rgba(237,137,54,0.2);  color: #f6ad55; border: 1px solid rgba(237,137,54,0.4); }
.conflict-sev.low    { background: rgba(113,128,150,0.15); color: var(--muted); border: 1px solid var(--border); }

.conflict-info { flex: 1; min-width: 0; }
.conflict-file {
    font-family: monospace;
    font-size: 12px;
    color: var(--text);
    word-break: break-all;
    margin-bottom: 4px;
}
.conflict-mods {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.conflict-mod-tag {
    background: rgba(102,126,234,0.15);
    color: var(--primary);
    border: 1px solid rgba(102,126,234,0.3);
    padding: 1px 7px;
    border-radius: 3px;
    font-size: 11px;
}

/* ── TABS ────────────────────────────────────────────────────────────────────── */

.tab-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    padding: 0 24px;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
    white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn i { font-size: 12px; }

.tab-content { display: none; }
.tab-content.active { display: contents; }

/* ── INPUTS ──────────────────────────────────────────────────────────────────── */

input[type="text"],
input[type="password"],
input[type="number"] {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 9px 12px;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}
input::placeholder { color: var(--muted); }

.setting-input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    padding: 5px 8px;
    font-size: 13px;
    width: 100%;
    max-width: 160px;
    transition: border-color 0.2s;
}
.setting-input:focus { outline: none; border-color: var(--primary); }
.setting-number { max-width: 90px; text-align: right; }

.setting-select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    padding: 5px 8px;
    font-size: 12px;
    max-width: 160px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.setting-select:focus { outline: none; border-color: var(--primary); }

/* ── LOOKUP RESULT ───────────────────────────────────────────────────────────── */

.lookup-result {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lookup-result.loading { background: rgba(113,128,150,0.1); color: var(--muted); }
.lookup-result.success { background: rgba(72,187,120,0.1); color: var(--success); border: 1px solid rgba(72,187,120,0.2); }
.lookup-result.error   { background: rgba(229,62,62,0.1); color: var(--offline); border: 1px solid rgba(229,62,62,0.2); }

/* ── MODAL ───────────────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    text-align: center;
}

.modal-icon { font-size: 40px; margin-bottom: 16px; }
.modal-icon.danger  i { color: var(--danger); }
.modal-icon.warning i { color: var(--warning); }

.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.modal-body  { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

.sched-presets {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.sched-presets .btn { padding: 5px 12px; font-size: 12px; }

/* ── LOGIN ───────────────────────────────────────────────────────────────────── */

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 380px;
}

.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .fa-skull { font-size: 40px; color: var(--accent); }
.login-logo h2 { margin-top: 10px; font-size: 18px; letter-spacing: 2px; font-weight: 700; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .btn { justify-content: center; margin-top: 4px; }
.login-link { text-align: center; margin-top: 16px; font-size: 13px; }
.login-link a { color: var(--primary); text-decoration: none; }
.login-link a:hover { text-decoration: underline; }

.flash-messages { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash-msg { padding: 10px 14px; border-radius: 6px; font-size: 13px; }
.flash-msg.error   { background: rgba(229,62,62,0.1); color: var(--offline); border: 1px solid rgba(229,62,62,0.2); }
.flash-msg.success { background: rgba(72,187,120,0.1); color: var(--success); border: 1px solid rgba(72,187,120,0.2); }

/* ── SETTINGS FORM ───────────────────────────────────────────────────────────── */

.settings-loading {
    color: var(--muted);
    font-size: 13px;
    padding: 20px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-group { margin-bottom: 20px; }
.settings-group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-height: 42px;
}
.setting-row-bool { grid-column: span 1; }

/* ── SETTINGS SUB-TABS ───────────────────────────────────────────────────────── */

.settings-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}
.settings-subtab-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface2);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.settings-subtab-btn:hover { color: var(--text); border-color: var(--primary); }
.settings-subtab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── SETTINGS V2 (server settings — per-field rows) ─────────────────────────── */

.settings-list { display: flex; flex-direction: column; }
.setting-row-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    min-height: 62px;
}
.setting-row-v2:last-child { border-bottom: none; }
.setting-v2-left {
    flex: 1;
    min-width: 0;
}
.setting-v2-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
}
.setting-v2-desc {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 5px;
    line-height: 1.4;
}
.setting-v2-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}
.setting-key-tag {
    font-size: 10px;
    font-family: monospace;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 3px;
    color: var(--muted);
}
.setting-def-tag {
    font-size: 10px;
    font-family: monospace;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    padding: 2px 7px;
    border-radius: 3px;
    color: var(--primary);
}
.setting-v2-right {
    flex-shrink: 0;
    min-width: 180px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.setting-row-v2-bool .setting-v2-right { min-width: 60px; }
.setting-textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    font-family: inherit;
    font-size: 12px;
}

.setting-label {
    font-size: 12px;
    color: var(--text);
    font-weight: 500;
    flex-shrink: 0;
    max-width: 60%;
}

/* ── TOGGLE SWITCH ───────────────────────────────────────────────────────────── */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.toggle-switch input { display: none; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: 0.2s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: var(--muted);
    border-radius: 50%;
    transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
    border-color: var(--primary);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: white;
}

/* ── SANDBOX SECTIONS ────────────────────────────────────────────────────────── */

.sandbox-section { border-top: 1px solid var(--border); margin-top: 4px; }
.sandbox-section:first-child { border-top: none; }

.sandbox-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 13px;
    color: var(--muted);
    transition: color 0.2s;
}
.sandbox-section-header:hover { color: var(--text); }
.sandbox-section-header.open  { color: var(--text); }
.sandbox-section-header .chevron { font-size: 11px; transition: transform 0.2s; flex-shrink: 0; }
.sandbox-section-header.open .chevron { transform: rotate(180deg); }
.sandbox-section-body { display: none; padding-bottom: 16px; }
.sandbox-section-body.open { display: block; }

.section-mod-tag {
    background: rgba(118,75,162,0.25);
    color: var(--accent);
    border: 1px solid rgba(118,75,162,0.4);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: middle;
    margin-left: 6px;
    text-transform: uppercase;
}

.settings-mod-divider {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--muted);
    text-transform: uppercase;
    padding: 16px 4px 8px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}

.settings-actions {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.save-status {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-basis: 100%;
    min-height: 20px;
}
.save-status.success { color: var(--success); }
.save-status.error   { color: var(--offline); }

/* ── SETTING TOOLTIPS ────────────────────────────────────────────────────────── */

.setting-help {
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: 10px;
    cursor: help;
    position: relative;
    margin-left: 5px;
    vertical-align: middle;
    flex-shrink: 0;
}
.setting-help:hover { color: var(--primary); }
.setting-help::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a202c;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 11px;
    border-radius: 7px;
    font-size: 11px;
    line-height: 1.45;
    white-space: normal;
    width: 230px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.setting-help:hover::after { opacity: 1; visibility: visible; }

/* ── SPAWN SETTINGS ──────────────────────────────────────────────────────────── */

.spawn-items-list .spawn-item-row { min-height: 38px; }
.spawn-items-add-row { margin-top: 2px; }
.spawn-item-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.spawn-item-hint code {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: monospace;
}
.spawn-item-hint a { color: var(--primary); text-decoration: none; }
.spawn-item-hint a:hover { text-decoration: underline; }

.spawn-point-actions {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 0;
    margin-bottom: 4px;
}

.force-spawn-coords {
    margin-top: 12px;
    padding: 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.spawn-map-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
}
.spawn-map-link:hover { text-decoration: underline; }

.spawn-force-warning {
    background: rgba(237,137,54,0.1);
    border: 1px solid rgba(237,137,54,0.3);
    color: var(--warning);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.regions-disabled .mod-list,
.regions-disabled .add-mod-section { opacity: 0.35; pointer-events: none; }

/* ── PLAYERS TAB ─────────────────────────────────────────────────────────────── */

.player-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.player-name {
    flex: 0 0 160px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.role-badge.admin     { background: rgba(229,62,62,0.2);   color: #fc8181; border: 1px solid rgba(229,62,62,0.35); }
.role-badge.moderator { background: rgba(237,137,54,0.2);  color: #f6ad55; border: 1px solid rgba(237,137,54,0.35); }
.role-badge.gm        { background: rgba(102,126,234,0.2); color: #a3b4f8; border: 1px solid rgba(102,126,234,0.35); }
.role-badge.observer  { background: rgba(72,187,120,0.15); color: #68d391;  border: 1px solid rgba(72,187,120,0.3); }
.role-badge.priority  { background: rgba(99,179,237,0.15); color: #90cdf4;  border: 1px solid rgba(99,179,237,0.3); }
.role-badge.user      { background: rgba(113,128,150,0.1); color: var(--muted); border: 1px solid var(--border); }

.player-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.player-dot-online  { background: var(--online); box-shadow: 0 0 5px var(--online); }
.player-dot-offline { background: var(--border); }
.player-row-offline { opacity: 0.55; }
.player-row-offline:hover { opacity: 0.8; }

.player-count-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
    margin-left: 6px;
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}
.player-role-select { font-size: 12px; padding: 3px 8px; min-width: 110px; }

.player-fb       { font-size: 11px; white-space: nowrap; margin-left: 4px; }
.player-fb-ok    { color: var(--online); }
.player-fb-error { color: #fc8181; }

/* ── EVENTS TAB ──────────────────────────────────────────────────────────────── */

.cmd-group { margin-bottom: 20px; }
.cmd-group:last-child { margin-bottom: 0; }
.cmd-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cmd-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.cmd-feedback {
    margin-top: 8px;
    font-size: 12px;
    min-height: 18px;
    color: transparent;
}
.cmd-feedback-ok    { color: var(--success); }
.cmd-feedback-error { color: var(--offline); }

/* Weather slider */
.slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.slider-label {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.slider-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    width: 30px;
    text-align: right;
    flex-shrink: 0;
}

.weather-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.weather-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 4px rgba(102,126,234,0.5);
}
.weather-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: none;
}

/* Time picker */
.time-picker-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.time-input {
    max-width: 64px;
    text-align: center;
}
.time-colon {
    font-size: 20px;
    font-weight: 700;
    color: var(--muted);
    line-height: 1;
}

/* ── CONSOLE TAB ─────────────────────────────────────────────────────────────── */

.log-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.log-filter-input {
    width: 150px;
    font-size: 12px;
    padding: 4px 8px;
    height: 30px;
}
.log-auto-label { font-size: 12px; color: var(--muted); }

.log-viewer {
    background: #0b0d10;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    height: 420px;
    overflow-y: auto;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 11.5px;
    line-height: 1.55;
}
.log-line { white-space: pre-wrap; word-break: break-all; padding: 0 0 1px; }
.log-error   { color: #fc8181; }
.log-warn    { color: #f6ad55; }
.log-connect { color: #68d391; }
.log-disc    { color: #fc8181; opacity: 0.8; }
.log-admin   { color: #b794f4; }
.log-default { color: #718096; }
.log-empty   { color: var(--muted); padding: 20px; text-align: center; font-family: inherit; }

/* ── BACKUPS TAB ─────────────────────────────────────────────────────────────── */

.backup-stats {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 18px;
}
.backup-stat { display: flex; flex-direction: column; gap: 2px; }
.backup-stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.backup-stat-value { font-size: 24px; font-weight: 700; line-height: 1; }

.backup-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
}
.backup-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.backup-icon.auto   { background: rgba(102,126,234,0.15); color: var(--primary); }
.backup-icon.manual { background: rgba(72,187,120,0.15);  color: var(--success); }

.backup-info-col { flex: 1; min-width: 0; }
.backup-name {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.backup-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.backup-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 4px;
    flex-shrink: 0;
}
.backup-badge.auto   { background: rgba(102,126,234,0.2); color: var(--primary); border: 1px solid rgba(102,126,234,0.35); }
.backup-badge.manual { background: rgba(72,187,120,0.2);  color: var(--success); border: 1px solid rgba(72,187,120,0.35); }

.backup-size {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
}

.backup-create-notice {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
}
.backup-footer-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 7px;
    line-height: 1.5;
}

/* ── STAT BAR (Dashboard top row) ────────────────────────────────────────────── */

.stat-bar {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.stat-tile {
    padding: 18px 22px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.stat-tile-last { border-right: none; }

.stat-tile-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.stat-tile-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-status-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
}

.stat-tile-val {
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}
.stat-online-val { color: var(--online); }
.stat-pz-val     { color: var(--accent); font-size: 22px; }

.stat-tile-sub {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.3;
}

.stat-tile-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}
.stat-tile-meta span {
    font-size: 11px;
    color: var(--muted);
    opacity: 0.7;
}

.stat-tile-bar {
    height: 4px;
    background: var(--surface2);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

.stat-players-btn {
    margin-top: 6px;
    font-size: 11px;
    padding: 4px 10px;
}

/* ── DASHBOARD CHARTS ROW ────────────────────────────────────────────────────── */

.dash-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr 280px;
    gap: 20px;
}

.dash-chart-card { display: flex; flex-direction: column; }

.dash-chart-area { flex: 1; min-height: 80px; }

.dash-players-mini {
    display: flex;
    flex-direction: column;
}
.dash-players-mini .card-label { margin-bottom: 10px; }

/* ── PERF BARS (shared across stat-bar and charts) ────────────────────────────── */

.perf-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}
.perf-bar-cpu { background: linear-gradient(90deg, #fc8181, #e53e3e); }
.perf-bar-ram { background: linear-gradient(90deg, #63b3ed, #4299e1); }
.perf-bar-pz  { background: linear-gradient(90deg, #b794f4, #764ba2); }
.perf-bar-fill.perf-bar-high { filter: brightness(1.15); }

/* ── SPARKLINES ──────────────────────────────────────────────────────────────── */

.sparkline-svg {
    display: block;
    width: 100%;
    height: 70px;
}

/* ── INPUT MODAL ─────────────────────────────────────────────────────────────── */

.imod-field { text-align: left; margin-top: 12px; }
.imod-select, .imod-input { width: 100%; max-width: 100%; }

/* ── MEDIA QUERIES ───────────────────────────────────────────────────────────── */

/* ── RESET TO DEFAULT BUTTON ────────────────────────────────────────────────── */

.btn-reset-default {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.setting-row-v2:hover .btn-reset-default { opacity: 1; }
.btn-reset-default:hover { color: var(--primary); border-color: var(--primary); }
.field-reset-flash { transition: background 0.1s; background: rgba(102, 126, 234, 0.2) !important; }

/* ── MAP ────────────────────────────────────────────────────────────────────── */

.map-card { display: flex; flex-direction: column; }
.map-osd-container {
    position: relative;
    width: 100%;
    height: 520px;
    background: #0d1117;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin: 12px 0 0;
}
.map-wrap {
    position: relative;
    width: 100%;
    height: 520px;
    background: #0d1117;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin: 12px 0 0;
}
/* OSD player marker overlays */
.map-pin {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
    cursor: default;
    transform: translate(-50%, -50%);
}
.map-pin-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.6);
    flex-shrink: 0;
}
.map-pin-label {
    font-size: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 2px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.8);
    pointer-events: none;
}
.map-pin-online .map-pin-dot  { background: #48bb78; box-shadow: 0 0 6px #48bb7899; }
.map-pin-online .map-pin-label { color: #c6f6d5; }
.map-pin-offline .map-pin-dot { background: #718096; }
.map-pin-offline .map-pin-label { color: #a0aec0; }
.map-pin-dead .map-pin-dot    { background: #fc8181; box-shadow: 0 0 4px #fc818166; }
.map-pin-dead .map-pin-label  { color: #fed7d7; }
.map-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13,15,18,0.7);
    color: var(--muted);
    font-size: 14px;
    gap: 8px;
    z-index: 5;
}
.map-coords-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 4px 0;
}
.map-cursor-coords { font-size: 11px; color: var(--muted); font-family: monospace; }
.map-player-count  { font-size: 11px; color: var(--muted); }
.map-legend {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 11px;
    color: var(--muted);
    padding: 6px 0 0;
}
.map-legend-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px;
}
.map-legend-dot.online  { background: #48bb78; box-shadow: 0 0 6px #48bb7880; }
.map-legend-dot.offline { background: #718096; }
.map-legend-dot.dead    { background: #fc8181; }
.map-status-text { font-size: 11px; color: var(--muted); }

/* City name labels on map */
.map-city-label {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #f0e6c8;
    white-space: nowrap;
    text-shadow: 0 0 4px #000, 0 1px 3px #000, 0 0 8px rgba(0,0,0,0.9);
    letter-spacing: 0.5px;
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 0.9;
    background: rgba(0,0,0,0.4);
    padding: 2px 7px;
    border-radius: 3px;
    border: 1px solid rgba(240,230,200,0.2);
}

/* OSD built-in navigator (minimap) */
.navigator {
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
    opacity: 0.85 !important;
}
.navigator:hover { opacity: 1 !important; }

/* OSD zoom controls */
.openseadragon-container .zoomIn,
.openseadragon-container .zoomOut,
.openseadragon-container .home,
.openseadragon-container .fullpage {
    background: rgba(20,24,30,0.85) !important;
    border: 1px solid var(--border) !important;
    border-radius: 4px !important;
}

@media (max-width: 1100px) {
    .stat-bar { grid-template-columns: 1fr 1fr 1fr; }
    .stat-tile:nth-child(3) { border-right: none; }
    .stat-tile:nth-child(4) { border-top: 1px solid var(--border); }
    .stat-tile:nth-child(5) { border-top: 1px solid var(--border); border-right: none; }
    .dash-charts-row { grid-template-columns: 1fr 1fr; }
    .dash-players-mini { grid-column: span 2; }
}

@media (max-width: 900px) {
    .grid-3        { grid-template-columns: 1fr 1fr; }
    .events-grid   { grid-template-columns: 1fr; }
    .action-cards-grid { grid-template-columns: 1fr 1fr; }
    .dash-charts-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .grid-2      { grid-template-columns: 1fr; }
    .grid-3      { grid-template-columns: 1fr; }
    .stat-bar    { grid-template-columns: 1fr 1fr; }
    .stat-tile   { border-right: none; border-bottom: 1px solid var(--border); }
    .stat-tile-last { border-bottom: none; }
    .events-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .action-cards-grid { grid-template-columns: 1fr 1fr; }
    .tab-bar-right { display: none; }
    main { padding: 16px; }
    header { padding: 0 16px; }
    .tab-btn { padding: 12px 12px; font-size: 12px; }
}

/* ── VERSION CARD ────────────────────────────────────────────────────────────── */

.version-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.version-number {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.version-build {
    font-size: 12px;
    color: var(--muted);
    font-family: monospace;
}

.version-branch {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.branch-stable   { background: rgba(72,187,120,0.15);  color: var(--online);  border: 1px solid rgba(72,187,120,0.3); }
.branch-unstable { background: rgba(237,137,54,0.15);  color: var(--warning); border: 1px solid rgba(237,137,54,0.3); }
.branch-legacy   { background: rgba(113,128,150,0.15); color: var(--muted);   border: 1px solid rgba(113,128,150,0.3); }

.version-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
}

.version-badge-ok      { background: rgba(72,187,120,0.1);  color: var(--online);  border: 1px solid rgba(72,187,120,0.2); }
.version-badge-update  { background: rgba(237,137,54,0.1);  color: var(--warning); border: 1px solid rgba(237,137,54,0.3); }
.version-badge-unknown { background: rgba(113,128,150,0.1); color: var(--muted);   border: 1px solid rgba(113,128,150,0.2); }

.version-update-form {
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

/* Update progress */

.update-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.update-step-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.update-step-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    color: var(--muted);
}

.update-step-label { color: var(--muted); }

.update-step-row.done   .update-step-icon { background: rgba(72,187,120,0.15); color: var(--success); border-color: var(--success); }
.update-step-row.done   .update-step-label { color: var(--text); }
.update-step-row.active .update-step-icon { background: rgba(102,126,234,0.15); color: var(--primary); border-color: var(--primary); }
.update-step-row.active .update-step-label { color: var(--text); font-weight: 600; }
.update-step-row.error  .update-step-icon { background: rgba(229,62,62,0.15); color: var(--danger);  border-color: var(--danger); }
.update-step-row.error  .update-step-label { color: var(--offline); }

.update-msg {
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
    padding-left: 32px;
}

.update-error {
    font-size: 12px;
    color: var(--offline);
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(229,62,62,0.08);
    border: 1px solid rgba(229,62,62,0.2);
    border-radius: 6px;
}
