:root {
    --bg: #07080d;
    --bg-card: rgba(14, 16, 26, 0.72);
    --bg-card-solid: #0e101a;
    --border: rgba(255, 255, 255, 0.08);
    --text: #e8eaef;
    --text-muted: #8b93a7;
    --primary: #6ea8fe;
    --primary-hover: #93c5fd;
    --accent: #a78bfa;
    --danger: #f87171;
    --success: #4ade80;
    --warning: #fbbf24;
    --radius: 14px;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

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

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

/* Aurora background */
.bg-aurora {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: float 18s ease-in-out infinite;
}

.b1 {
    width: 520px; height: 520px;
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
    top: -120px; left: -80px;
}

.b2 {
    width: 480px; height: 480px;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    bottom: -100px; right: -60px;
    animation-delay: -6s;
}

.b3 {
    width: 360px; height: 360px;
    background: radial-gradient(circle, #22d3ee 0%, transparent 70%);
    top: 40%; left: 45%;
    animation-delay: -12s;
    opacity: 0.25;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

.particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.35;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(24px, -18px) scale(1.05); }
}

.page-wrap, .auth-wrap {
    position: relative;
    z-index: 1;
}

/* Auth / welcome */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 4px);
    box-shadow: var(--shadow);
    padding: 28px 26px 24px;
}

.auth-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 22px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(110,168,254,0.2), rgba(167,139,250,0.15));
    border: 1px solid var(--border);
    color: var(--primary);
}

.brand-mark svg { width: 28px; height: 28px; }

.auth-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
}

.auth-sub {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-desc {
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.auth-switch {
    margin-top: 18px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 8, 13, 0.75);
    backdrop-filter: blur(12px);
}

.app-header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.brand-mark-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-text {
    font-weight: 700;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.2;
}

.brand-text small {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 2px;
}

.app-nav {
    display: flex;
    gap: 6px;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
}

.nav-link {
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: 0.15s;
    background: transparent;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.06);
}

.nav-link.active {
    color: #fff;
    background: rgba(110,168,254,0.12);
    border-color: rgba(110,168,254,0.25);
}

.nav-link.nav-danger {
    color: #fecaca;
    border-color: rgba(248,113,113,0.25);
}

.nav-link.nav-danger:hover {
    background: rgba(248,113,113,0.1);
}

.nav-link.nav-login {
    color: var(--primary-hover);
    border-color: rgba(110,168,254,0.25);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap;
}

.user-pill {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 600;
}

.nav-sep {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}

.nav-dropdown { position: relative; display: inline-flex; }
.nav-dropdown::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
}
.nav-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow);
    z-index: 9999;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown .dropdown-menu:hover { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 600;
}
.dropdown-item:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(110,168,254,0.2);
    color: var(--text);
}
.dropdown-item.active {
    color: #fff;
    background: rgba(110,168,254,0.12);
    border-color: rgba(110,168,254,0.25);
}
.dropdown-hint {
    color: var(--text-muted);
    font-size: 0.68rem;
    margin-left: auto;
    font-weight: 700;
    opacity: 0.8;
}

.page-content {
    position: relative;
    z-index: 1;
}

/* Layout */
.page-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 20px 48px;
}

.container {
    position: relative;
    z-index: 1;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 20px;
    margin-bottom: 18px;
}

.card-title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.card-desc {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Forms */
.form-row { margin-bottom: 14px; }
.form-row label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.input, select.input, textarea.input {
    width: 100%;
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    color: var(--text);
    font-size: 0.92rem;
    font-family: inherit;
}

.input:focus {
    outline: none;
    border-color: rgba(110,168,254,0.55);
    box-shadow: 0 0 0 3px rgba(110,168,254,0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: 0.15s;
    font-family: inherit;
    text-decoration: none;
}

.btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.15); }
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-color: transparent;
    color: #fff;
}
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
.btn-block { width: 100%; }

@media (max-width: 768px) {
    .app-header-inner { flex-direction: column; align-items: flex-start; }
    .app-nav { width: 100%; }
    .header-user { margin-left: 0; width: 100%; }
}
