@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap');

:root {
    --bg: #0a0e17;
    --bg-elev: #0f1421;
    --bg-card: #131a29;
    --bg-card-hover: #161e30;
    --bg-input: #0c111c;
    --border: #22293b;
    --border-soft: #1a2131;
    --text: #eef1f7;
    --text-dim: #aab2c5;
    --muted: #6b7590;
    --accent: #4f8cff;
    --accent-2: #22d3ee;
    --accent-soft: rgba(79, 140, 255, .12);
    --good: #34d399;
    --good-soft: rgba(52, 211, 153, .12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .12);
    --radius: 14px;
    --radius-sm: 9px;
    --shadow-card: 0 1px 2px rgba(0,0,0,.2), 0 12px 32px -12px rgba(0,0,0,.5);
    --shadow-pop: 0 20px 60px -20px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(1100px 520px at 12% -8%, rgba(79,140,255,.14), transparent 60%),
        radial-gradient(900px 480px at 108% 8%, rgba(34,211,238,.10), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; transition: color .15s ease; }
a:hover { color: #7fd8ef; }
::selection { background: var(--accent-soft); color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid var(--bg); }

/* ---------- Navbar ---------- */
.navbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; height: 62px;
    background: rgba(15, 20, 33, .78);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--border-soft);
}
.navbar-brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 16px; letter-spacing: .2px; color: var(--text);
}
.navbar-brand .mark {
    width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #04101f; font-weight: 800; font-size: 14px;
    box-shadow: 0 6px 18px -6px rgba(79,140,255,.65);
}
.navbar-brand .sub { color: var(--muted); font-weight: 600; }
.navbar-links { display: flex; gap: 4px; align-items: center; }
.navbar-links a {
    display: flex; align-items: center; gap: 7px;
    color: var(--text-dim); font-weight: 600; font-size: 13.5px;
    padding: 8px 14px; border-radius: 9px; transition: all .15s ease;
}
.navbar-links a svg { width: 16px; height: 16px; opacity: .85; }
.navbar-links a:hover { color: var(--text); background: rgba(255,255,255,.04); text-decoration: none; }
.navbar-links a.active { color: var(--text); background: var(--accent-soft); }
.navbar-user { display: flex; align-items: center; gap: 14px; }
.user-chip {
    display: flex; align-items: center; gap: 9px;
    padding: 5px 12px 5px 6px; border-radius: 999px;
    background: var(--bg-card); border: 1px solid var(--border);
}
.user-avatar {
    width: 26px; height: 26px; border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #04101f;
}
.user-chip .name { font-weight: 600; color: var(--text); font-size: 13px; }
.badge-boss {
    font-size: 9.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase;
    color: var(--warn); background: var(--warn-soft); padding: 2px 6px; border-radius: 5px;
}
.btn-link-plain {
    background: none; border: none; color: var(--muted); cursor: pointer;
    font: inherit; font-weight: 600; padding: 8px 4px; display: flex; align-items: center; gap: 6px;
    transition: color .15s ease;
}
.btn-link-plain:hover { color: var(--danger); }
.btn-link-plain svg { width: 15px; height: 15px; }

/* ---------- Per-server sub-nav ---------- */
.server-subnav {
    position: sticky; top: 62px; z-index: 30;
    background: rgba(10, 14, 23, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-soft);
}
.server-subnav-inner {
    max-width: 1180px; margin: 0 auto; padding: 10px 24px;
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px;
}
.server-back {
    display: flex; align-items: center; gap: 4px;
    color: var(--muted); font-weight: 600; font-size: 12.5px; flex-shrink: 0;
}
.server-back svg { width: 15px; height: 15px; }
.server-back:hover { color: var(--text); text-decoration: none; }
.server-subnav-name {
    font-weight: 800; font-size: 14px; color: var(--text);
    padding-right: 18px; border-right: 1px solid var(--border); flex-shrink: 0;
    white-space: nowrap;
}
.server-subnav-links { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.server-subnav-links a {
    display: flex; align-items: center; gap: 6px; white-space: nowrap;
    color: var(--text-dim); font-weight: 600; font-size: 13px;
    padding: 7px 13px; border-radius: 8px; transition: all .15s ease;
}
.server-subnav-links a svg { width: 15px; height: 15px; opacity: .85; }
.server-subnav-links a:hover { color: var(--text); background: rgba(255,255,255,.04); text-decoration: none; }
.server-subnav-links a.active { color: var(--text); background: var(--accent-soft); }
.server-subnav-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; margin: 0 2px; display: none; }
@media (min-width: 700px) { .server-subnav-sep { display: block; } }

/* ---------- Forms / small UI bits reused across the new modules ---------- */
.field-sm { margin-bottom: 12px; }
.field-sm label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 5px; }
.field-sm input, .field-sm select, .field-sm textarea {
    width: 100%; padding: 9px 11px; border-radius: 7px;
    background: var(--bg-input); border: 1px solid var(--border); color: var(--text); font-size: 13.5px; font-family: inherit;
}
.field-sm textarea { resize: vertical; }
.field-sm input:focus, .field-sm select:focus, .field-sm textarea:focus { outline: none; border-color: var(--accent); }
.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 7px; }
.btn-danger { background: var(--danger); color: #2a0505; box-shadow: none; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-dim); box-shadow: none; }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border);
    background: transparent; color: var(--text-dim); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--muted); }
.icon-btn svg { width: 14px; height: 14px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.toggle-row:last-child { border-bottom: none; }
.toggle-row .label { font-weight: 600; font-size: 13.5px; }
.toggle-row .desc { color: var(--muted); font-size: 12px; margin-top: 2px; }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: background .15s ease;
}
.switch .slider::before {
    content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
    background: #fff; border-radius: 999px; transition: transform .15s ease;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.notification-dot {
    position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 999px;
    background: var(--danger); border: 2px solid var(--bg-card);
}
.thread-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.thread-item:last-child { border-bottom: none; }
.thread-avatar {
    width: 32px; height: 32px; border-radius: 999px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #04101f;
}
.qa-block { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.qa-block:last-child { border-bottom: none; }
.qa-block .q { font-weight: 700; font-size: 13px; color: var(--text-dim); margin-bottom: 4px; }
.qa-block .a { font-size: 13.5px; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.status-pill.open { background: var(--accent-soft); color: var(--accent-2); }
.status-pill.accepted { background: var(--good-soft); color: var(--good); }
.status-pill.rejected { background: var(--danger-soft); color: var(--danger); }

/* ---------- Server cards ---------- */
.server-card {
    display: block; color: var(--text);
    background: linear-gradient(180deg, var(--bg-card), var(--bg-elev));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow-card);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.server-card:hover {
    text-decoration: none; transform: translateY(-3px);
    border-color: rgba(79,140,255,.4); box-shadow: 0 20px 40px -18px rgba(0,0,0,.6);
}
.server-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.server-card-icon {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-2);
}
.server-card-icon svg { width: 18px; height: 18px; }
.server-card-name { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.server-card-address { color: var(--muted); font-size: 12px; margin-top: 4px; }
.server-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-soft);
    font-size: 12.5px; color: var(--muted); font-weight: 600;
}
.server-card-open { display: flex; align-items: center; gap: 4px; color: var(--accent-2); font-weight: 700; }
.server-card-open svg { width: 14px; height: 14px; }

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 36px 24px 64px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 25px; font-weight: 800; margin: 0; letter-spacing: -.3px; display: flex; align-items: center; gap: 12px; }
.page-subtitle { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

/* ---------- Cards ---------- */
.card {
    background: linear-gradient(180deg, var(--bg-card), var(--bg-elev));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
}
.card h2 {
    font-size: 14px; font-weight: 700; margin: 0 0 16px; color: var(--text);
    display: flex; align-items: center; gap: 8px; letter-spacing: .1px;
}
.card h2 svg { width: 16px; height: 16px; color: var(--accent-2); }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 820px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat-tile {
    display: flex; align-items: center; gap: 14px; padding: 18px 20px;
    transition: transform .15s ease, border-color .15s ease;
}
.stat-tile:hover { transform: translateY(-2px); border-color: var(--border); }
.stat-icon {
    width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
    display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2);
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.good { background: var(--good-soft); color: var(--good); }
.stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat-tile .value { font-size: 24px; font-weight: 800; letter-spacing: -.3px; line-height: 1.1; }
.stat-tile .label { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 2px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: -4px -4px 0; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 14px; }
thead th {
    color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 10.5px;
    letter-spacing: .5px; border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border-soft); transition: background .12s ease; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.02); }
td.muted, .muted { color: var(--muted); }
td.mono, .mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

.rank-pill {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 999px; font-weight: 800; font-size: 12px;
    background: rgba(255,255,255,.04); color: var(--muted);
}
.rank-pill.gold { background: linear-gradient(135deg,#facc15,#f59e0b); color: #3a2400; }
.rank-pill.silver { background: linear-gradient(135deg,#e2e8f0,#94a3b8); color: #1e2430; }
.rank-pill.bronze { background: linear-gradient(135deg,#f0a878,#c2703f); color: #351a06; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .2px;
}
.badge-success { background: var(--good-soft); color: var(--good); }
.badge-muted { background: rgba(255,255,255,.05); color: var(--muted); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-live { position: relative; padding-left: 16px; }
.badge-live::before {
    content: ''; position: absolute; left: 7px; top: 50%; transform: translateY(-50%);
    width: 6px; height: 6px; border-radius: 999px; background: var(--good);
    box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 1.8s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); }
    70% { box-shadow: 0 0 0 6px rgba(52,211,153,0); }
    100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; border-bottom: 1px solid var(--border-soft); padding-bottom: 14px; }
.tab {
    padding: 8px 16px; border-radius: 999px; background: transparent; border: 1px solid var(--border);
    color: var(--text-dim); font-weight: 600; font-size: 13px; transition: all .15s ease;
}
.tab:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.tab.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04101f; border-color: transparent; }

/* ---------- Auth ---------- */
.auth-wrapper {
    display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px;
}
.auth-card {
    background: linear-gradient(180deg, var(--bg-card), var(--bg-elev));
    border: 1px solid var(--border); border-radius: 18px; padding: 40px 36px;
    width: 380px; box-shadow: var(--shadow-pop); position: relative; overflow: hidden;
}
.auth-card::before {
    content: ''; position: absolute; inset: -1px -1px auto -1px; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 26px; }
.auth-brand .mark {
    width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #04101f; font-weight: 800; font-size: 18px;
    box-shadow: 0 10px 26px -8px rgba(79,140,255,.7);
}
.auth-brand .title { font-weight: 800; font-size: 18px; letter-spacing: .2px; }
.auth-brand .subtitle { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.field input {
    width: 100%; padding: 11px 13px; border-radius: 9px;
    background: var(--bg-input); border: 1px solid var(--border); color: var(--text); font-size: 14px;
    font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input::placeholder { color: var(--muted); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 20px; border-radius: 9px; border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #04101f; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit;
    transition: filter .15s ease, transform .1s ease;
    box-shadow: 0 8px 20px -8px rgba(79,140,255,.55);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }

.error-text { color: var(--danger); font-size: 12px; margin-top: 4px; }
.alert { padding: 13px 15px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; line-height: 1.5; border: 1px solid transparent; }
.alert-success { background: var(--good-soft); color: var(--good); border-color: rgba(52,211,153,.25); }
.alert-info { background: var(--accent-soft); color: #a9c8ff; border-color: rgba(79,140,255,.25); }
.auth-links { text-align: center; margin-top: 20px; color: var(--muted); font-size: 13px; }

.empty-state {
    text-align: center; padding: 52px 20px; color: var(--muted);
}
.empty-state svg { width: 34px; height: 34px; margin-bottom: 12px; opacity: .5; }
.empty-state p { margin: 0; font-size: 13.5px; }

/* pagination (Laravel's Tailwind-flavored links, restyled) */
nav[role="navigation"] { display: flex; justify-content: center; margin-top: 6px; }
nav[role="navigation"] span, nav[role="navigation"] a {
    color: var(--text-dim) !important; font-size: 12px !important;
}
