/* ─── SpellForged Moderation Panel ─── */
/* Dark admin theme */

:root {
    --bg-root: #0c0e14;
    --bg-surface: #12151e;
    --bg-raised: #1a1e2e;
    --bg-hover: #222740;
    --border: #2a2f45;
    --border-light: #353b55;
    
    --text-primary: #e2e4ea;
    --text-secondary: #8b90a5;
    --text-muted: #5c6180;
    
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --red: #ef4444;
    --red-dim: #7f1d1d;
    --green: #22c55e;
    --green-dim: #14532d;
    --blue: #3b82f6;
    --purple: #a855f7;
    --yellow: #f59e0b;
    --cyan: #06b6d4;
    
    --sidebar-w: 240px;
    --radius: 8px;
    --radius-sm: 5px;
    --transition: 0.15s ease;
    
    --font-body: 'Outfit', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-root);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ─── Sidebar ─── */

.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-icon {
    font-size: 28px;
    margin-bottom: 4px;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.brand-icon.large { font-size: 48px; margin-bottom: 12px; }

.brand-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand-sub {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent);
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin-bottom: 4px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.user-name {
    font-size: 13px;
    color: var(--text-secondary);
}

.logout-btn { font-size: 13px; }

/* ─── Content Area ─── */

.content {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 32px 40px;
    min-height: 100vh;
    max-width: 1200px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.back-link {
    display: inline-block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.back-link:hover { color: var(--text-secondary); }

/* ─── Stats Grid ─── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stats-grid.mini {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin-bottom: 24px;
}

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

.stat-card.mini { padding: 14px 16px; }

.stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    font-family: var(--font-mono);
}

.stat-card.mini .stat-value { font-size: 20px; }
.stat-value.red { color: var(--red); }
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }
.stat-value.purple { color: var(--purple); }

/* ─── Panels ─── */

.panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.panel-danger { border-color: var(--red-dim); }

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h2 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.panel-body { padding: 16px 20px; }
.panel-body.no-pad { padding: 0; }

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

@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
    .content { padding: 20px; }
}

/* ─── Server Status ─── */

.server-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.server-row:last-child { border-bottom: none; }

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

.server-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.server-dot.online {
    background: var(--green);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.server-name {
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-mono);
}

.server-players {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-bar {
    width: 80px;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
}

.player-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.player-count {
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    min-width: 45px;
    text-align: right;
}

/* ─── List Rows ─── */

.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.list-row:last-child { border-bottom: none; }

.list-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.player-link {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent);
}

.player-link:hover { color: var(--accent-hover); }

.list-sub {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ─── Activity List ─── */

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.activity-row:last-child { border-bottom: none; }

.activity-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: white;
    flex-shrink: 0;
    min-width: 52px;
    text-align: center;
}

.activity-text {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 0;
}

.activity-text strong { color: var(--text-primary); }

.activity-reason {
    color: var(--text-muted);
    font-style: italic;
}

.time-ago {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    font-family: var(--font-mono);
}

/* ─── Detail Grid ─── */

.detail-grid {
    display: grid;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
}

.mono { font-family: var(--font-mono); font-size: 13px; }

/* ─── Moderator Grid ─── */

.mod-grid {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.mod-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-raised);
    border-radius: var(--radius-sm);
}

.mod-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--purple);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.mod-name {
    font-size: 13px;
    font-weight: 600;
}

.mod-count {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ─── Data Table ─── */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    background: var(--bg-raised);
}

.data-table td {
    padding: 12px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
    background: rgba(99, 102, 241, 0.04);
}

.reason-cell {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.inline-form { display: inline; }

/* ─── Badges ─── */

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-red { background: var(--red-dim); color: var(--red); }
.badge-green { background: var(--green-dim); color: var(--green); }

/* ─── Buttons ─── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-body);
    border: 1px solid var(--border);
    background: var(--bg-raised);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: white;
}

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

.btn-success {
    background: var(--green-dim);
    border-color: var(--green);
    color: var(--green);
}
.btn-success:hover { background: #166534; }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ─── Forms ─── */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-root);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    transition: border-color var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input::placeholder { color: var(--text-muted); }

.input-sm { width: 200px; padding: 6px 12px; font-size: 13px; }
.input-lg { flex: 1; }

.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ─── Pagination ─── */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.page-info {
    font-size: 13px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ─── Modal ─── */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
}

.modal.show { display: flex; align-items: center; justify-content: center; }

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 { font-size: 17px; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ─── Flash Messages ─── */

.flash-messages {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flash-success {
    background: var(--green-dim);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.flash-error {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.6;
}

.flash-close:hover { opacity: 1; }

/* ─── Empty State ─── */

.empty-state {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.empty-state.padded { padding: 40px; }

/* ─── Login Page ─── */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-root);
}

.login-container {
    width: 100%;
    max-width: 380px;
    padding: 20px;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-form-wrap {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.login-form .form-group:last-of-type { margin-bottom: 20px; }

/* ─── Responsive ─── */

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .brand-text, .brand-sub, .nav-item span:not(.nav-icon),
    .user-name, .logout-btn span:not(.nav-icon) {
        display: none;
    }
    .sidebar-brand { padding: 16px 12px; }
    .content { margin-left: 60px; padding: 20px 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .data-table { font-size: 13px; }
    .data-table th, .data-table td { padding: 10px 12px; }
}

/* ─── User Management Additions ─── */

.badge-purple { background: rgba(168, 85, 247, 0.15); color: var(--purple); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.badge-you { background: rgba(99, 102, 241, 0.15); color: var(--accent); font-size: 10px; margin-left: 6px; }

.action-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-danger-outline {
    background: transparent;
    border-color: var(--red);
    color: var(--red);
}
.btn-danger-outline:hover {
    background: var(--red-dim);
    color: var(--red);
}

.select-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-root);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b90a5' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.select-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.select-input option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* ─── Server Online/Offline States ─── */

.server-offline { opacity: 0.5; }

.server-dot.offline {
    background: var(--text-muted);
    box-shadow: none;
}

.server-stale {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-left: 6px;
}

.player-bar-fill.bar-offline {
    background: var(--text-muted);
}

/* ─── Staff Chat ─── */

.chat-panel {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 400px;
}

.chat-panel .panel-body { display: none; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg {
    padding: 10px 14px;
    background: var(--bg-raised);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border);
}

.chat-msg-web {
    border-left-color: var(--accent);
    background: rgba(99, 102, 241, 0.06);
}

.chat-msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.chat-sender {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.chat-server {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    background: var(--bg-hover);
    padding: 1px 6px;
    border-radius: 3px;
}

.chat-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-left: auto;
}

.chat-msg-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.chat-input-wrap {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.chat-input-form {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-root);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.chat-status {
    font-size: 12px;
    color: var(--green);
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    display: inline-block;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ─── Online Players ─── */

.stat-pill {
    font-size: 13px;
    color: var(--green);
    font-family: var(--font-mono);
    background: var(--green-dim);
    padding: 4px 12px;
    border-radius: 20px;
}

.player-badge {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    font-family: var(--font-mono);
    margin-left: 8px;
}

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

.player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-raised);￼
￼
￼
1776253474276_image
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all var(--transition);
    color: inherit;
    text-decoration: none;
}

.player-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
    color: inherit;
}

.player-head {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.player-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.player-card-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.player-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ─── Chat Role Colors ─── */

.chat-sender.chat-role-admin {
    color: #dc2626 !important;
}

.chat-sender.chat-role-moderator {
    color: #ea580c !important;
}

.chat-sender.chat-role-player {
    color: var(--text-primary) !important;
}