:root {
    --bg: #0b0d11;
    --surface: #111318;
    --surface2: #161a21;
    --border: rgba(255,255,255,0.07);
    --teal: #20b2aa;
    --teal-dim: rgba(32,178,170,0.15);
    --red: #ef4444;
    --red-dim: rgba(239,68,68,0.15);
    --yellow: #f59e0b;
    --text: #e2e8f0;
    --text-muted: #64748b;
    --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Saira', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--teal); text-decoration: none; }
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:2rem; background:radial-gradient(ellipse at 60% 40%,rgba(32,178,170,0.07) 0%,transparent 60%),radial-gradient(ellipse at 20% 80%,rgba(139,92,246,0.06) 0%,transparent 50%); }
.login-layout { position:relative; display:flex; align-items:center; justify-content:center; }
.login-box {flex-shrink:0; background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:2.5rem 2rem; width:100%; max-width:380px; text-align:center; }
.quick-panel { position:absolute; left:calc(100% + 1rem); top:50%; transform:translateY(-50%); width:260px; border-radius:16px; padding:1.5rem; display:flex; flex-direction:column; gap:1rem; }
.quick-title { font-size:.75rem; font-weight:600; text-transform:uppercase; letter-spacing:.1em; color:var(--text-muted); margin-bottom:.25rem; }
.service-card { display:flex; flex-direction:column; gap:.5rem; padding:1rem; background:linear-gradient(145deg,rgba(255,255,255,.04),transparent),var(--surface2); border:1px solid var(--border); border-radius:12px; color:var(--text); transition:transform .2s ease,border-color .2s ease; }
.service-card:hover { transform:translateY(-2px); border-color:var(--teal); }
.service-icon { font-size:1.5rem; }
.service-name { font-size:1rem; font-weight:700; }
.service-desc { font-size:.75rem; color:var(--text-muted); }
.service-btn { margin-top:.5rem; padding:.45rem; border-radius:8px; background:var(--teal-dim); border:1px solid rgba(32,178,170,.3); color:var(--teal); text-align:center; font-size:.75rem; font-weight:600; }
@media(max-width:700px) { .login-layout { flex-direction:column; } .login-box { width:100%; } .quick-panel { width:100%; } }
.login-logo { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.25rem; }
.login-logo span { color: var(--teal); }
.login-sub { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2rem; }
.register-sub { color: var(--text-muted); font-size: 0.85rem; margin-top: 2rem; }
.login-error { background: var(--red-dim); border: 1px solid rgba(239,68,68,0.3); border-radius: var(--radius); padding: 0.6rem 1rem; font-size: 0.85rem; color: var(--red); margin-bottom: 1rem; }
.field { margin-bottom: 1rem; text-align: left; }
.field label { display: block; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.35rem; letter-spacing: 0.05em; text-transform: uppercase; }
input[type=password], input[type=text], input[type=email], input[type=number], input[type=url], input[type=file], select, textarea { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: 'Saira', sans-serif; font-size: 0.9rem; padding: 0.6rem 0.85rem; outline: none; transition: border-color 0.2s; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 70px; font-family: monospace; font-size: 0.82rem; }
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.1rem; border-radius: var(--radius); font-family: 'Saira', sans-serif; font-size: 0.85rem; font-weight: 500; cursor: pointer; border: none; transition: opacity 0.15s, transform 0.1s; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn-teal { background: var(--teal); color: #000; }
.btn-red { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.btn-ghost { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.btn:hover { opacity: 0.85; }
.btn-full { width: 100%; justify-content: center; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0.85rem 1.5rem; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.topbar-brand { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }
.topbar-brand span { color: var(--teal); }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.main { max-width: 960px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.tabs { display: flex; gap: 0.4rem; margin-bottom: 2rem; border-bottom: 1px solid var(--border); }
.tab { padding: 0.55rem 1.1rem; border-radius: 8px 8px 0 0; font-size: 0.85rem; font-weight: 500; cursor: pointer; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; font-family: 'Saira', sans-serif; transition: color 0.15s; margin-bottom: -1px; }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.tab:hover:not(.active) { color: var(--text); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.section-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 0.75rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.card-header-left { display: flex; align-items: center; gap: 0.75rem; }
.server-game { font-weight: 600; font-size: 0.95rem; }
.server-meta { font-size: 0.78rem; color: var(--text-muted); }
.badge { font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; }
.badge-maint { background: rgba(245,158,11,0.2); color: var(--yellow); }
.badge-query { background: var(--teal-dim); color: var(--teal); }
.badge-fallback { background: rgba(139,92,246,0.2); color: #a78bfa; }
.badge-modded { background: rgba(249,115,22,0.2); color: #fb923c; }
.card-body { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; display: none; }
.card-body.open { display: block; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
@media (max-width: 600px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.card-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }
.add-card { background: var(--surface); border: 1px dashed rgba(32,178,170,0.3); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
.add-card summary { cursor: pointer; font-weight: 500; color: var(--teal); list-style: none; }
.add-card summary::before { content: '+ '; }
.add-card[open] summary::before { content: '- '; }
.add-card .form-inner { margin-top: 1rem; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.toggle-label { font-size: 0.85rem; }
.toggle { position: relative; width: 38px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; cursor: pointer; transition: background 0.2s; }
.toggle-slider::after { content: ''; position: absolute; left: 3px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted); transition: transform 0.2s, background 0.2s; }
.toggle input:checked + .toggle-slider { background: var(--teal-dim); border-color: var(--teal); }
.toggle input:checked + .toggle-slider::after { transform: translateX(18px); background: var(--teal); }
.custom-fields { margin-top: 1rem; }
.custom-field-row { display: grid; grid-template-columns: 1fr 90px 1fr auto; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
@media (max-width: 600px) { .custom-field-row { grid-template-columns: 1fr 1fr; } .custom-field-row .btn-sm { grid-column: span 2; justify-self: end; } }
.custom-fields-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.sf-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
@media (max-width: 600px) { .sf-row { grid-template-columns: 1fr; } }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); padding: 0.65rem 1.3rem; border-radius: 8px; font-size: 0.85rem; font-weight: 500; z-index: 999; animation: fadeup 0.25s ease; }
.toast-success { background: rgba(32,178,170,0.2); border: 1px solid rgba(32,178,170,0.4); color: var(--teal); }
.toast-error { background: var(--red-dim); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
@keyframes fadeup { from { opacity:0; transform: translateX(-50%) translateY(10px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
.alert-box { background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.2); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
.chevron { transition: transform 0.2s; display: inline-block; font-style: normal; }
.chevron.open { transform: rotate(180deg); }
.query-section { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.query-section-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--teal); margin-bottom: 0.75rem; }
.modded-map-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.35rem; }
footer { position: relative; z-index: 1; padding: 14px 24px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; color: var(--text-muted); }

.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.stat-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.5rem; }
.stat-value { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.6rem; }
.stat-value-text { font-size: 1rem; font-weight: 500; margin-bottom: 0; }
.stat-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.4rem; }
.progress-bar { width: 100%; height: 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--teal); border-radius: 6px; transition: width 1.2s cubic-bezier(0.22, 0.61, 0.36, 1), background-color 0.4s ease; }
.progress-fill.progress-danger { background: var(--red); }
.disk-row { padding: 0.85rem 1rem; }
.disk-row-top { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.5rem; }
.log-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.log-table th { text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
.log-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); }
.log-table tr:last-child td { border-bottom: none; }
.wip-banner { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25); border-radius: var(--radius); padding: 0.85rem 1.1rem; font-size: 0.85rem; color: var(--yellow); margin-bottom: 1.5rem; }
.wip-disabled { opacity: 0.55; pointer-events: none; }
.access-badge { display: inline-block; font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 4px; font-weight: 600; background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); margin-right: 0.3rem; }
.access-badge-root { background: var(--red-dim); border-color: rgba(239,68,68,0.3); color: var(--red); }
.access-badge-mod { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); color: var(--yellow); }
.access-badge-botlab { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3); color: #818cf8; }
.access-badge-cockpit { background: rgba(139,92,246,0.15); border-color: rgba(139,92,246,0.3); color: #a78bfa; }
.access-badge-user { background: var(--teal-dim); border-color: rgba(32,178,170,0.3); color: var(--teal); }
.access-edit-form { display: flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
.access-check { display: flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; color: var(--text-muted); cursor: pointer; }
.access-check input { width: auto; }

/* ===== DISCORD BOTS ===== */
.bot-card {}
.bot-status-dot { display:inline-block; width:10px; height:10px; border-radius:50%; background:var(--text-muted); margin-right:0.25rem; flex-shrink:0; transition:background 0.4s; }
.pin-form { padding:0.5rem 0; }
.pin-error { color:var(--red); font-size:0.8rem; margin-top:0.5rem; min-height:1.2em; }
.bot-controls { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:0.75rem; margin-bottom:1rem; }
.bot-log-wrap { margin-top:0.75rem; }
.bot-log { background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius); padding:0.85rem 1rem; font-size:0.75rem; font-family:monospace; line-height:1.5; max-height:320px; overflow-y:auto; white-space:pre-wrap; word-break:break-all; color:var(--text); }

/* ===== SERVER DASHBOARD ===== */
.dashboard-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:1rem;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:16px;
    padding:1.5rem;
    margin-bottom:1.75rem;
}
.dashboard-title {
    font-size:1.4rem;
    font-weight:700;
    letter-spacing:-0.02em;
}
.dashboard-meta {
    display:flex;
    align-items:center;
    gap:.45rem;
    color:var(--text-muted);
    font-size:.85rem;
    margin-top:.35rem;
}
.dashboard-time {
    text-align:right;
}
#server-clock {
    font-size:1.3rem;
    font-weight:700;
}
.status-dot {
    width:9px;
    height:9px;
    border-radius:50%;
    background:var(--teal);
    box-shadow:0 0 12px rgba(32,178,170,.7);
    animation:statusPulse 2s infinite;
}
@keyframes statusPulse {
    0%,100% { opacity:1; }
    50% { opacity:.45; }
}
.dashboard-grid {
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:1rem;
    margin-bottom:2rem;
}
.dashboard-card {
    background:linear-gradient(145deg,rgba(255,255,255,.04),transparent),var(--surface);
    border:1px solid var(--border);
    border-radius:14px;
    padding:1rem;
    transition:transform .2s ease,border-color .2s ease;
}
.dashboard-card:hover {
    transform:translateY(-3px);
    border-color:rgba(32,178,170,.25);
}
.dashboard-card-header {
    display:flex;
    align-items:center;
    gap:.6rem;
    margin-bottom:.75rem;
}
.dashboard-icon {
    width:32px;
    height:32px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--surface2);
    border-radius:10px;
    font-size:1.5rem;
}
.dashboard-value {
    font-size:1.75rem;
    font-weight:700;
    line-height:1;
    margin-bottom:.55rem;
}
.dashboard-text-value {
    font-size:1.2rem;
}
.dashboard-card .progress-bar {
    margin-top:.75rem;
    height:8px;
}
.usage-low {
    background:var(--teal);
}
.usage-medium {
    background:var(--yellow);
}
.usage-high {
    background:var(--red);
}
.disk-grid {
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:1rem;
    margin-bottom:2rem;
}
.disk-card {
    background:linear-gradient(145deg,rgba(255,255,255,.03),transparent),var(--surface);
    border:1px solid var(--border);
    border-radius:16px;
    padding:1.2rem;
    transition:transform .2s ease,border-color .2s ease;
}
.disk-card:hover {
    transform:translateY(-2px);
}
.disk-card-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:1rem;
    font-size:.85rem;
    margin-bottom:.75rem;
}
.disk-percent {
    font-size:1.6rem;
    font-weight:700;
    margin-bottom:.8rem;
}
.disk-card .progress-bar {
    height:9px;
}
.dashboard-widget-title {
    margin-top:1.5rem;
}
.dashboard-widget-grid {
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:1rem;
}
.dashboard-widget {
    display:flex;
    align-items:center;
    gap:.85rem;
    background: linear-gradient(145deg,rgba(255,255,255,.04),transparent),var(--surface);
    border:1px dashed rgba(32,178,170,.25);
    border-radius:14px;
    padding:1.1rem;
    opacity:.75;
    transition:opacity .2s ease,border-color .2s ease;
}
.dashboard-widget:hover {
    opacity:1;
    border-color:var(--teal);
}
.dashboard-card.updated,
.disk-card.updated {
    animation:dashboardFlash .6s ease;
}
@keyframes dashboardFlash {
    0% { transform:scale(1); }
    50% { transform:scale(1.02); }
    100% { transform:scale(1); }
}
@media(max-width:900px) {
    .dashboard-grid {
        grid-template-columns:1fr;
    }
    .dashboard-widget-grid {
        grid-template-columns:repeat(2,1fr);
    }
}
@media(max-width:600px) {
    .dashboard-header {
        flex-direction:column;
        align-items:flex-start;
    }
    .dashboard-time {
        text-align:left;
    }
    .disk-grid,
    .dashboard-widget-grid {
        grid-template-columns:1fr;
    }
}
.cpu-cores-list {
    margin-top: 0.75rem;
}

.cpu-core-row {
    margin-bottom: 0.45rem;
}

.cpu-core-header {
    display:flex;
    justify-content:space-between;
    font-size:0.72rem;
    color:var(--text-muted);
    margin-bottom:0.25rem;
}
.discord-alert {
    background: rgba(178, 47, 32,0.08);
    border: 1px solid rgba(178, 47, 32,0.35);
    # border-left: 3px solid var(--teal);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.82rem;
    color: var(--text);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
}
.discord-alert code {
    background: rgba(0,0,0,0.15);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}
