:root {
    --bg-dark: #0f0518;
    --bg-main: rgba(26, 10, 40, 0.9);
    --bg-sidebar: rgba(20, 8, 30, 0.95);
    --bg-card: rgba(35, 15, 55, 0.7);
    --bg-card-hover: rgba(50, 20, 80, 0.9);
    --bg-input: rgba(15, 5, 25, 0.8);
    
    --text-main: #ffffff;
    --text-muted: #d0c0e0;
    
    --primary-purple: #c43bf0;
    --primary-orange: #f29c29;
    --gradient: linear-gradient(90deg, var(--primary-purple), var(--primary-orange));

    --accent: var(--primary-orange);
    --accent-hover: #ffb74d;
    --accent-light: rgba(242, 156, 41, 0.2);
    
    --primary: var(--primary-purple);
    --primary-hover: #df6aff;
    
    --danger: #ff4d4d;
    --danger-hover: #ff6666;
    
    --success: #36b37e;
    --success-hover: #42c78d;
    
    --border: rgba(196, 59, 240, 0.4);
    --border-light: rgba(196, 59, 240, 0.6);
    
    --radius: 12px;
    --radius-lg: 16px;
}

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

body { 
    font-family: 'Open Sans', sans-serif; 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    display: flex; 
    height: 100vh; 
    overflow: hidden; 
    font-size: 14px;
    line-height: 1.6;
    position: relative;
}

/* Minecraft Blocky Grid Background */
.mc-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(rgba(196, 59, 240, 0.03) 2px, transparent 2px),
        linear-gradient(90deg, rgba(242, 156, 41, 0.03) 2px, transparent 2px);
    background-size: 64px 64px;
    z-index: 0;
    pointer-events: none;
    animation: panBackground 120s linear infinite;
}

@keyframes panBackground {
    from { background-position: 0 0; }
    to { background-position: -640px 640px; }
}

.sidebar, .main-wrapper { z-index: 10; position: relative; }

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(168, 32, 255, 0.4);
}

h1, h2, h3, h4 { font-family: 'Montserrat', sans-serif; font-weight: 700; color: #fff; margin-bottom: 0.5rem; text-transform: uppercase; }
h3 { font-size: 1.1rem; }
.subtitle { color: var(--text-muted); font-size: 0.85rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.gap-3 { gap: 0.75rem; }

.sidebar { 
    width: 260px; 
    background-color: var(--bg-sidebar); 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
    z-index: 10;
}

.logo { 
    padding: 1.5rem 1.5rem; 
    border-bottom: 1px solid var(--border); 
}

.logo h2 { 
    font-size: 1.5rem; 
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    letter-spacing: 1px;
    margin-bottom: 0.25rem;
    font-style: italic;
}

.logo .accent { color: var(--accent); }

.server-status { 
    font-size: 0.75rem; 
    color: var(--success); 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    font-weight: 500; 
}

.status-dot { 
    width: 8px; 
    height: 8px; 
    background: var(--success); 
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success); 
}

.nav-menu { list-style: none; padding: 1rem 0.75rem; }

.nav-item { 
    padding: 0.75rem 1rem; 
    color: var(--text-muted); 
    cursor: pointer; 
    transition: all 0.3s ease; 
    font-weight: 700; 
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.25rem;
}

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

.nav-item.active { 
    color: #fff; 
    background: var(--gradient); 
    font-weight: 900;
    box-shadow: 0 4px 15px rgba(196, 59, 240, 0.4);
}

.main-wrapper { flex: 1; display: flex; flex-direction: column; }

.topbar { 
    padding: 1rem 2rem; 
    border-bottom: 2px solid; 
    border-image: var(--gradient) 1;
    background: var(--bg-main); 
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 73px;
    backdrop-filter: blur(10px);
}

.topbar h2 { 
    font-size: 1.25rem; 
    margin: 0;
    font-weight: 600;
}

.user-badge {
    background: var(--bg-card);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.content { 
    flex: 1; 
    padding: 2rem; 
    overflow-y: auto; 
}

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 1.5rem; 
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat-card { 
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    padding: 1.5rem; 
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(196, 59, 240, 0.1);
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(196, 59, 240, 0.2), inset 0 0 15px rgba(242, 156, 41, 0.2);
    border-color: var(--primary-orange);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient) !important;
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(196, 59, 240, 0.4);
}

.stat-info h3 { 
    color: var(--text-muted); 
    font-size: 0.85rem; 
    margin-bottom: 0.25rem; 
    font-weight: 500;
}

.stat-value { 
    font-size: 1.75rem; 
    font-weight: 700; 
    color: #fff; 
}

.section-card { 
    background: var(--bg-card); 
    border: 1px solid var(--border); 
    padding: 1.5rem; 
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(196, 59, 240, 0.05);
    backdrop-filter: blur(5px);
}

.section-header { 
    margin-bottom: 1.25rem; 
    padding-bottom: 1rem; 
    border-bottom: 1px solid var(--border); 
}

.table-container {
    overflow-x: auto;
}

.data-table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 0.9rem; 
}

.data-table th { 
    padding: 1rem; 
    border-bottom: 2px solid; 
    border-image: var(--gradient) 1;
    color: var(--text-main); 
    text-align: left; 
    font-weight: 700; 
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 0.8rem;
    background: rgba(10, 5, 15, 0.5);
}

.data-table td { 
    padding: 1rem; 
    border-bottom: 1px solid var(--border); 
    vertical-align: middle; 
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-card-hover); }

.empty-state {
    color: var(--text-muted);
    padding: 2rem !important;
    font-style: italic;
}

.btn { 
    border: none; 
    padding: 0.5rem 1rem; 
    font-family: 'Montserrat', sans-serif; 
    font-weight: 700; 
    cursor: pointer; 
    font-size: 0.85rem; 
    transition: all 0.3s ease; 
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
}

.btn:active { transform: scale(0.98); }

.btn-primary { 
    background: var(--gradient); 
    color: #fff; 
    box-shadow: 0 4px 15px rgba(196, 59, 240, 0.4);
}
.btn-primary:hover { 
    background: linear-gradient(90deg, #df6aff, #ffb74d); 
    box-shadow: 0 6px 20px rgba(242, 156, 41, 0.5);
    transform: translateY(-2px);
}

.btn-secondary { background: var(--border-light); color: #fff; }
.btn-secondary:hover { background: #4b5466; }

.btn-danger { background: rgba(255, 77, 77, 0.1); color: var(--danger); border: 1px solid rgba(255, 77, 77, 0.2); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-success { background: rgba(54, 179, 126, 0.1); color: var(--success); border: 1px solid rgba(54, 179, 126, 0.2); }
.btn-success:hover { background: var(--success); color: #fff; }

.btn-outline { background: transparent; border: 1px solid var(--border-light); color: var(--text-main); }
.btn-outline:hover { background: var(--bg-card-hover); border-color: var(--text-muted); }

.input-field { 
    background: var(--bg-input); 
    border: 1px solid var(--border); 
    color: #fff; 
    padding: 0.6rem 0.8rem; 
    font-family: 'Open Sans', sans-serif; 
    font-size: 0.9rem; 
    border-radius: var(--radius);
    transition: border-color 0.2s; 
}

.input-field:focus { 
    outline: none; 
    border-color: var(--primary-orange); 
    box-shadow: 0 0 0 2px var(--accent-light);
}

select.input-field { appearance: auto; }

.flex-row { display: flex; gap: 0.75rem; align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: 0.75rem; }

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.chip-container { display: flex; flex-wrap: wrap; gap: 8px; }

.perm-list { display: flex; flex-direction: column; gap: 8px; }
.perm-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: var(--bg-input); 
    border: 1px solid var(--border); 
    padding: 0.6rem 1rem; 
    border-radius: var(--radius);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.perm-row:hover { border-color: var(--border-light); }

.console-input-wrapper {
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.25rem;
    align-items: center;
}

.console-prompt {
    color: var(--accent);
    font-weight: bold;
    padding: 0 0.75rem;
    font-family: 'JetBrains Mono', monospace;
}

.console-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 0.5rem 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

.console-input:focus { outline: none; }

.divider {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 0.5rem 0;
}

.editor-container {
    height: 500px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

#config-editor { 
    width: 100%; 
    height: 100%; 
    background: var(--bg-input); 
    color: #e0e0e0; 
    border: none;
    padding: 1.5rem; 
    font-family: 'JetBrains Mono', monospace; 
    font-size: 0.85rem; 
    resize: none; 
    line-height: 1.6; 
}

#config-editor:focus { outline: none; }

.status-msg { margin-top: 0.75rem; font-size: 0.85rem; font-weight: 500; }
.text-center { text-align: center; }
