/* ============================================================
   Server Builder - dark enterprise layout (_ServerLayout.cshtml)
   ============================================================ */

:root {
    --bg: #070a0f;
    --sidebar: #0a0e14;
    --panel: #0e141d;
    --panel-hover: #141c28;
    --panel-soft: #111823;
    --line: #202b3b;
    --line-light: rgba(255,255,255,.07);
    --text: #f5f7fa;
    --muted: #8b9aaf;
    --muted-2: #65758b;
    --accent: #16d6a3;
    --accent-dark: #0db387;
    --accent-soft: rgba(22,214,163,.10);
    --blue: #4d8dff;
    --danger: #ff5d70;
    --warning: #ffb020;
    --success: #2fe0a7;
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius: 14px;
}

* { box-sizing: border-box; }

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
}

body {
    background:
        radial-gradient(circle at 70% 0%, rgba(77,141,255,.06), transparent 28%),
        radial-gradient(circle at 10% 20%, rgba(22,214,163,.04), transparent 25%),
        var(--bg);
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea { font-family: inherit; }

.server-app { min-height: 100vh; }

/* ---------- Sidebar ---------- */

.server-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: rgba(8,12,18,.98);
    border-right: 1px solid var(--line-light);
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
}

.sidebar-brand {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line-light);
}

.brand-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--blue));
    color: #03100d;
    font-size: 17px;
    font-weight: 900;
    box-shadow: 0 0 25px rgba(22,214,163,.13);
}

.brand-name { font-size: 15px; font-weight: 800; }

.brand-subtitle {
    margin-top: 2px;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: .25px;
}

.sidebar-menu {
    flex: 1;
    padding: 22px 13px;
    overflow-y: auto;
}

.menu-section-title {
    padding: 0 11px;
    margin: 8px 0 9px;
    font-size: 10px;
    font-weight: 700;
    color: #57677d;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 13px;
    margin-bottom: 4px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    transition: all .18s ease;
}

.menu-item:hover {
    color: var(--text);
    background: rgba(255,255,255,.035);
}

.menu-item.active {
    color: var(--text);
    background: var(--accent-soft);
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    width: 3px;
    height: 23px;
    border-radius: 0 5px 5px 0;
    background: var(--accent);
}

.menu-item.active .menu-icon { color: var(--accent); }

.menu-icon {
    width: 21px;
    text-align: center;
    color: #6d7d92;
    font-size: 14px;
}

.menu-badge {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 20px;
    background: rgba(77,141,255,.13);
    color: #8eb4ff;
    font-size: 9px;
    font-weight: 800;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--line-light);
}

.sidebar-help {
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(22,214,163,.07), rgba(77,141,255,.04));
    border: 1px solid rgba(22,214,163,.10);
}

.sidebar-help-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 9px;
    border-radius: 9px;
    background: rgba(22,214,163,.10);
    color: var(--accent);
}

.sidebar-help strong {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
}

.sidebar-help p {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
}

/* ---------- Content wrapper / Topbar ---------- */

.server-content-wrapper {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.server-topbar {
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--line-light);
    background: rgba(7,10,15,.86);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mobile-menu-btn {
    width: 39px;
    height: 39px;
    display: none;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: var(--panel);
    cursor: pointer;
}

.page-info h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.page-info span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.top-action-btn {
    height: 38px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: #cdd6e2;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: .18s ease;
}

.top-action-btn:hover {
    background: var(--panel-hover);
    color: var(--text);
}

.top-action-btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #03110d;
    font-weight: 800;
}

.top-action-btn.primary:hover { background: var(--accent-dark); }

/* ---------- User menu ---------- */

.user-menu { position: relative; }

.user-button {
    height: 40px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 9px 0 7px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.user-button:hover {
    background: var(--panel);
    border-color: var(--line);
}

.user-avatar {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(22,214,163,.18), rgba(77,141,255,.20));
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
}

.user-name { font-size: 11px; font-weight: 600; }

.user-role {
    margin-top: 1px;
    color: var(--muted);
    font-size: 9px;
}

.user-dropdown {
    width: 210px;
    position: absolute;
    top: 48px;
    right: 0;
    display: none;
    padding: 8px;
    background: #10161f;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0,0,0,.4);
}

.user-dropdown.open { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 11px;
}

.dropdown-item:hover {
    color: var(--text);
    background: rgba(255,255,255,.04);
}

.dropdown-separator {
    height: 1px;
    margin: 6px 0;
    background: var(--line-light);
}

/* ---------- Main area ---------- */

.server-main {
    padding: 27px;
    min-height: calc(100vh - var(--header-height));
}

.server-container {
    width: 100%;
    max-width: 1650px;
    margin: auto;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
}

.page-header p {
    max-width: 700px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.server-panel {
    background: linear-gradient(180deg, rgba(17,24,35,.94), rgba(12,17,25,.94));
    border: 1px solid var(--line-light);
    border-radius: var(--radius);
    box-shadow: 0 16px 42px rgba(0,0,0,.18);
}

/* ---------- Mobile ---------- */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 950;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

@media (max-width: 1000px) {
    .server-sidebar { transform: translateX(-100%); }
    .server-sidebar.open { transform: translateX(0); }
    .server-content-wrapper { margin-left: 0; }
    .mobile-menu-btn { display: flex; }
}

@media (max-width: 720px) {
    .server-topbar { padding: 0 14px; }
    .server-main { padding: 18px 13px 100px; }

    .top-action-text,
    .user-details { display: none; }

    .top-action-btn {
        width: 39px;
        padding: 0;
        justify-content: center;
    }

    .page-info span { display: none; }
    .page-header { display: block; }
}
