* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
}

input, textarea {
    user-select: text;
    -webkit-user-select: text;
}

body.auth-pending .nav-links,
body.auth-pending .sidebar-footer,
body.auth-pending .topbar {
    display: none;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.45); }

#app {
    display: flex;
    height: 100vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f0f13 0%, #050506 100%);
}

.sidebar {
    width: 252px;
    min-width: 252px;
    background: #050506;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 18px 12px;
    z-index: 10;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 8px 16px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}

.logo-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    
    object-fit: cover;
    background: #000;
}

.ryodan-title {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1.2px;
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--text);
}

.ryodan-title small {
    font-size: 10px;
    letter-spacing: 4px;
    color: var(--text-muted);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-links li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    color: var(--text-muted);
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
    user-select: none;
}

.nav-mark,
.btn-mark {
    display: inline-grid;
    place-items: center;
    width: 24px;
    min-width: 24px;
    height: 24px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0;
}

.nav-icon {
    position: relative;
    font-size: 0;
}

.nav-icon::before {
    content: '';
    color: currentColor;
    font-size: 15px;
    line-height: 1;
    font-weight: 900;
}

.icon-home::before { content: '⌂'; }
.icon-passport::before { content: '◈'; }
.icon-contracts::before { content: '▤'; }
.icon-inventory::before { content: '▦'; }
.icon-market::before { content: '◆'; }
.icon-roles::before { content: '✦'; }
.icon-games::before { content: '◬'; }
.icon-leaderboard::before { content: '≡'; }
.icon-control::before { content: '⚙'; }
.icon-logs::before { content: '☷'; }
.icon-wallet::before { content: '◇'; }
.icon-core::before { content: '✧'; }
.icon-bell::before { content: '◴'; }
.icon-theme::before { content: '☼'; }

.nav-links li:hover {
    color: var(--text);
    background: rgba(244,241,234,0.055);
    border-color: var(--border-soft);
}

.nav-links li.active {
    color: var(--text);
    background: rgba(180,22,42,0.16);
    border-color: rgba(180,22,42,0.42);
}

.nav-links li.active .nav-mark {
    background: var(--accent);
    color: var(--cream);
    border-color: var(--accent);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
}

.sidebar-version {
    font-size: 10px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-align: center;
}

.app-main {
    flex: 1;
    min-width: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: 70px minmax(0, 1fr);
    position: relative;
    z-index: 2;
}

.topbar {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 32px 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(5,5,6,0.88);
}

.topbar-kicker {
    display: block;
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 3px;
}

#topbar-page-title {
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.topbar-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.topbar-icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(244,241,234,0.035);
    color: var(--text-muted);
    cursor: pointer;
}

.topbar-icon-btn:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.topbar-dot {
    position: absolute;
    right: 7px;
    top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--danger);
}

.topbar-profile-chip {
    display: grid;
    grid-template-columns: 42px minmax(0, auto);
    align-items: center;
    gap: 10px;
    min-width: 148px;
}

.topbar-profile-chip span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.topbar-profile-chip strong,
.topbar-profile-chip small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-profile-chip strong {
    font-size: 13px;
}

.topbar-profile-chip small {
    color: var(--text-muted);
    font-size: 11px;
}

.topbar-user > span {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border: 1px solid var(--border-soft);
    border-radius: 7px;
    background: rgba(244,241,234,0.035);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

#topbar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    background: #000;
}

#page-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 28px 34px 40px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scroll-behavior: smooth;
    z-index: 1;
}

@keyframes fadeInSlideUp {
    0% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes slideInRight { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(8px); } }

.page-animated {
    animation: fadeInSlideUp 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}

#loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    overflow: hidden;
}

#loading-overlay[hidden],
.auth-screen[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.loading-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(5, 5, 6, 0.85), rgba(180, 22, 42, 0.35)),
        url('../images/anime_dark_profile_bg.jpg') center / cover no-repeat;
    filter: blur(6px);
    transform: scale(1.05);
    z-index: 0;
}

.loading-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
    max-width: min(420px, calc(100vw - 32px));
    background: rgba(10, 10, 12, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    
    border-radius: 28px;
    padding: 48px 40px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fadeInSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.loading-logo,
.spider-seal-img {
    width: 82px;
    height: 82px;
    border-radius: var(--radius-sm);
    
    background: #000;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.loading-title {
    font-size: 28px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--text);
}

.loading-title-error {
    color: var(--danger);
    font-size: 18px;
    margin-bottom: 8px;
}

.loading-error-text {
    max-width: 380px;
    text-align: center;
    line-height: 1.7;
    font-size: 13px;
    color: var(--text-muted);
}

.loading-action-btn {
    margin-top: 20px;
}

.oauth-success-title {
    font-size: 22px;
}

#loading-overlay p,
.loading-note {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.7;
    letter-spacing: 0;
}

.auth-consent-btn { min-height: 44px; }

.discord-only-screen {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(0,0,0,0.58), rgba(0,0,0,0.92)),
        url('../images/ryodan-banner.jpg') center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.discord-only-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 480px;
    padding: 34px 28px;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.discord-only-content h1 {
    font-size: 30px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--text);
    margin: 16px 0 8px;
}

.divider {
    width: 64px;
    height: 1px;
    background: rgba(255,255,255,0.46);
    margin: 16px auto;
}

.discord-only-content .subtitle {
    font-size: 11px;
    letter-spacing: 4px;
    color: var(--text-soft);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.discord-only-content .description {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 24px;
}

.instruction-box {
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    text-align: left;
}

.instruction-box p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 10px;
}

.instruction-box ol {
    padding-left: 20px;
    color: var(--text);
    font-size: 14px;
    line-height: 2;
}

.instruction-box code {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 7px;
    font-family: monospace;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition-normal), border-color var(--transition-normal), transform var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card.gothic {
    border-top-color: rgba(180,22,42,0.45);
}

.card.gothic:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

h1, h2, h3, h4 {
    font-weight: 800;
    letter-spacing: 0;
    color: var(--text);
}

h2 {
    font-size: 26px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 12px;
}

h2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border), transparent);
}

h3 { font-size: 17px; }

.btn {
    min-height: 38px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(244,241,234,0.055);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    background: rgba(244,241,234,0.1);
    border-color: var(--border-strong);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(180, 22, 42, 0.3);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #e3304a 0%, #8c1020 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(180, 22, 42, 0.5);
    color: #fff;
}

.btn-danger {
    background: rgba(217, 28, 52, 0.16);
    border-color: rgba(217, 28, 52, 0.5);
    color: #ff9aa7;
}

.btn-small {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
}

.btn-muted,
.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

input, select, textarea {
    background: #08090b;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: border-color var(--transition-fast), background var(--transition-fast);
    outline: none;
    font-family: var(--font-family);
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(180,22,42,0.62);
    background: #050506;
}

input::placeholder { color: var(--text-soft); }
select option { background: var(--bg-soft); color: var(--text); }

.spinner {
    width: 34px;
    height: 34px;
    
    border-top-color: var(--text);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

.page-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
}

#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text);
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: auto;
    min-width: 200px;
    max-width: 320px;
}

.toast.hiding { animation: fadeOut 0.35s forwards; }

.app-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0,0,0,0.76);
}

.app-dialog {
    width: min(460px, 100%);
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #0b0c0f;
    box-shadow: var(--shadow-lg);
}

.app-dialog-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--accent-hover);
    font-weight: 950;
    text-transform: uppercase;
    background: rgba(244,241,234,0.045);
}

.app-dialog-body {
    display: grid;
    gap: 9px;
    min-width: 0;
}

.app-dialog-body h3 {
    font-size: 18px;
}

.app-dialog-body p {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 13px;
}

.app-dialog-input {
    width: 100%;
    min-height: 86px;
    resize: vertical;
}

.app-dialog-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 520px) {
    .app-dialog {
        grid-template-columns: 1fr;
    }

    .app-dialog-actions {
        flex-direction: column-reverse;
    }

    .app-dialog-actions .btn {
        width: 100%;
    }
}

.progress-bar-wrapper,
.xp-bar-wrapper {
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-wrapper {
    height: 7px;
    border: 1px solid var(--border-soft);
    margin: 12px 0 6px;
}

.progress-bar-fill,
.xp-bar-fill {
    height: 100%;
    background: var(--text);
    border-radius: 4px;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.xp-bar-wrapper {
    height: 5px;
    margin: 8px 0 5px;
}

.xp-label {
    font-size: 11px;
    color: var(--text-soft);
    letter-spacing: 0;
}

@media (max-width: 768px) {
    #app { flex-direction: column; }

    .sidebar {
        width: 100%;
        min-width: unset;
        max-width: 100vw;
        flex-direction: row;
        padding: 10px 12px;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow-x: auto;
        overflow-y: hidden;
    }

    .logo {
        margin: 0 14px 0 0;
        padding: 0 14px 0 0;
        border-bottom: none;
        border-right: 1px solid var(--border-soft);
        flex-shrink: 0;
    }

    .logo-icon { width: 34px; height: 34px; }
    .ryodan-title { font-size: 14px; }
    .sidebar-footer { display: none; }
    .nav-links {
        min-width: 0;
        flex: 1 1 auto;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 5px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
    }
    .nav-links li {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 12px;
        min-height: 36px;
        padding: 7px 10px;
    }
    .nav-mark { display: inline-grid; width: 22px; min-width: 22px; height: 22px; }
    .app-main { width: 100%; height: calc(100vh - 55px); grid-template-rows: auto minmax(0, 1fr); }
    .topbar {
        padding: 10px 14px;
        gap: 10px;
        overflow: hidden;
    }
    .topbar-user > span { display: none; }
    .topbar-profile-chip {
        min-width: 0;
        grid-template-columns: 34px;
    }
    .topbar-profile-chip span {
        display: none;
    }
    .topbar-icon-btn {
        width: 34px;
        height: 34px;
    }
    .topbar-icon-btn:not(:first-child) {
        display: none;
    }
    #topbar-avatar {
        width: 34px;
        height: 34px;
    }
    #topbar-page-title { font-size: 16px; }
    #page-content { padding: 18px 14px 28px; }
    h2 { font-size: 22px; }
}

@media (max-width: 768px) {
    .sidebar {
        gap: 8px;
        scrollbar-width: none;
    }

    .sidebar::-webkit-scrollbar,
    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links {
        flex: 1 1 auto;
        min-width: 0;
    }

    .nav-links li {
        width: 38px;
        justify-content: center;
        overflow: hidden;
        padding-inline: 7px;
    }

    .nav-links li > span:not(.nav-mark) {
        display: none;
    }

    .nav-links li.active {
        width: auto;
        max-width: 150px;
        justify-content: flex-start;
        padding-inline: 10px;
    }

    .nav-links li.active > span:not(.nav-mark) {
        display: inline;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

@media (max-width: 420px) {
    .logo {
        margin-right: 8px;
        padding-right: 8px;
    }

    .ryodan-title {
        display: none;
    }

    .nav-links li.active {
        max-width: 132px;
    }
}

/* Auth Screen Glassmorphism */
.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background:
        linear-gradient(180deg, rgba(16, 16, 20, 0.9), rgba(0, 0, 0, 0.98)),
        url('../images/ryodan-banner.jpg') center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-box {
    background: rgba(16, 16, 20, 0.65);
    backdrop-filter: blur(12px);
    
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: fadeInSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.auth-box h1 {
    font-size: 28px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #999);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-status {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.instruction-box {
    background: rgba(0, 0, 0, 0.4);
    
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: left;
    margin-top: 24px;
}

.instruction-box p {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 13px;
}

.instruction-box ol {
    margin: 0;
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.8;
}

.instruction-box code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text);
    font-family: monospace;
}

.auth-logo {
    width: 90px;
    height: 90px;
    border-radius: 20px;
    margin: 0 auto 20px auto;
    display: block;
    object-fit: cover;
    
}

.auth-box h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #fff;
}

.auth-box p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
}

/* Release polish */
body {
    background:
        linear-gradient(180deg, rgba(143, 199, 255, 0.035), transparent 34%),
        linear-gradient(115deg, transparent 0%, rgba(180, 22, 42, 0.08) 46%, transparent 76%),
        var(--bg);
}

#app {
    background:
        linear-gradient(135deg, rgba(143, 199, 255, 0.055), transparent 42%),
        linear-gradient(180deg, rgba(244, 241, 234, 0.035), transparent 22%),
        var(--bg);
}



.sidebar {
    background:
        linear-gradient(180deg, rgba(244, 241, 234, 0.035), transparent 28%),
        rgba(5, 5, 6, 0.96);
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.025);
}

.logo-icon,
#topbar-avatar,
.auth-logo {
    border: 1px solid rgba(244, 241, 234, 0.18);
    box-shadow: 0 0 0 3px rgba(180, 22, 42, 0.08);
}

.nav-links li {
    position: relative;
}

.nav-links li.active {
    background:
        linear-gradient(90deg, rgba(180,22,42,0.22), rgba(143,199,255,0.055)),
        rgba(244,241,234,0.035);
    box-shadow: inset 3px 0 0 var(--accent);
}

.nav-links li:hover .nav-mark,
.nav-links li.active .nav-mark {
    border-color: rgba(244, 241, 234, 0.34);
}

.topbar {
    background:
        linear-gradient(90deg, rgba(5,5,6,0.94), rgba(16,18,22,0.88)),
        rgba(5,5,6,0.9);
    backdrop-filter: blur(14px);
}

.topbar-profile-chip,
.topbar-icon-btn,
.card,
.auth-box {
    background: var(--surface-elevated);
    border-color: var(--border-soft);
}

.topbar-icon-btn:focus-visible,
.nav-links li:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-cold);
    outline-offset: 2px;
}

.btn {
    min-width: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015)),
        rgba(244,241,234,0.045);
}

.btn:hover:not(:disabled) {
    color: var(--text);
    transform: translateY(-1px);
}

.btn-primary {
    color: #ffffff;
    background:
        linear-gradient(135deg, rgba(215, 42, 63, 0.96), rgba(118, 16, 29, 0.96));
    border-color: rgba(244, 241, 234, 0.18);
    box-shadow: 0 10px 24px rgba(180, 22, 42, 0.18);
}

.btn-primary:hover:not(:disabled) {
    background:
        linear-gradient(135deg, rgba(226, 58, 78, 0.98), rgba(143, 18, 34, 0.98));
}

input,
select,
textarea {
    background: rgba(5, 6, 8, 0.74);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}

::-webkit-scrollbar-thumb {
    background: rgba(143, 199, 255, 0.24);
}

@media (max-width: 768px) {
    .sidebar {
        background: rgba(5, 5, 6, 0.98);
    }
}
