:root {
    --bg: #0f1117;
    --bg-soft: #171b26;
    --card: #1d2330;
    --text: #f3f5f9;
    --muted: #9aa4b8;
    --accent: #5865f2;
    --accent-hover: #4752c4;
    --danger: #ed4245;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top, rgba(88, 101, 242, 0.18), transparent 35%),
        linear-gradient(180deg, #0b0d12, var(--bg));
    color: var(--text);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header,
.footer,
.main {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
}

.logo {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: var(--text);
}

.logo:hover,
.logo:focus,
.logo:active {
    color: var(--text);
}

.brand-logo {
    background: linear-gradient(135deg, #f3f5f9 0%, #b8bfff 50%, #5865f2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-link {
    font-size: 1.75rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(135deg, #f3f5f9, #b8bfff, #5865f2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: filter 0.2s, text-shadow 0.2s;
}

.brand-link:hover {
    filter: brightness(1.15);
    text-shadow: 0 0 24px rgba(88, 101, 242, 0.45);
}

.header-spacer {
    min-height: 1.1rem;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
}

.nav a:hover {
    color: var(--text);
}

.nav a.nav-admin {
    color: var(--accent);
    font-weight: 600;
}

.nav a.nav-admin:hover {
    color: #7b86ff;
}

.main {
    flex: 1;
    padding: 2rem 0 4rem;
}

.footer {
    padding: 1.5rem 0 2rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.hero,
.card-center {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.eyebrow {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
}

h1 {
    margin: 0.5rem 0 1rem;
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.1;
}

.lead {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    margin-top: 1.5rem;
    padding: 0.9rem 1.4rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.15s ease, background 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-discord {
    background: var(--accent);
    color: white;
}

.btn-discord:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}

.alert {
    margin: 1.5rem 0;
    padding: 0.9rem 1rem;
    border-radius: 12px;
}

.alert-error {
    background: rgba(237, 66, 69, 0.12);
    border: 1px solid rgba(237, 66, 69, 0.35);
    color: #ffb4b5;
}

.card {
    background: rgba(29, 35, 48, 0.9);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card h2 {
    margin-top: 0;
}

.dashboard {
    display: grid;
    gap: 1.5rem;
}

.welcome-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(29, 35, 48, 0.9);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 3px solid rgba(88, 101, 242, 0.5);
}

.muted {
    color: var(--muted);
}

.placeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.admin-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.18);
    border: 1px solid rgba(88, 101, 242, 0.35);
    color: #b8bfff;
    font-size: 0.8rem;
    font-weight: 600;
}

.admin-meta {
    display: grid;
    gap: 1rem;
    margin: 0;
}

.admin-meta div {
    display: grid;
    gap: 0.25rem;
}

.admin-meta dt {
    color: var(--muted);
    font-size: 0.85rem;
}

.admin-meta dd {
    margin: 0;
}

.admin-meta code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .welcome-card {
        flex-direction: column;
        text-align: center;
    }
}

/* Cabinet layout */
.main {
    width: min(1200px, calc(100% - 2rem));
}

.cabinet {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.cabinet-sidebar {
    position: sticky;
    top: 1rem;
    background: rgba(29, 35, 48, 0.9);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.cabinet-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.cabinet-user strong {
    display: block;
    font-size: 0.95rem;
}

.cabinet-user .muted {
    font-size: 0.8rem;
}

.avatar-sm {
    width: 48px;
    height: 48px;
    border-width: 2px;
}

.cabinet-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cabinet-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.cabinet-nav a:hover,
.cabinet-nav a.active {
    background: rgba(88, 101, 242, 0.15);
    color: var(--text);
}

.badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    min-width: 1.25rem;
    text-align: center;
}

.cabinet-heading {
    margin: 0 0 1.25rem;
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stats-grid,
.keys-grid,
.detail-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.keys-grid,
.detail-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stat-label {
    color: var(--muted);
    font-size: 0.85rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
}

.alert-success {
    background: rgba(87, 242, 135, 0.12);
    border: 1px solid rgba(87, 242, 135, 0.35);
    color: #9dffc0;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
}

.cabinet-form {
    display: grid;
    gap: 1rem;
}

.form-row {
    display: grid;
    gap: 0.4rem;
}

.form-row label {
    color: var(--muted);
    font-size: 0.85rem;
}

.form-row input,
.form-row select,
.form-row textarea {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 0.65rem 0.85rem;
    font: inherit;
}

.inline-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form input {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    padding: 0.65rem 0.85rem;
    font: inherit;
}

.search-results {
    display: none;
    position: absolute;
    z-index: 20;
    width: 100%;
    max-height: 240px;
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-top: 0.25rem;
    box-shadow: var(--shadow);
}

.search-results.open {
    display: block;
}

.member-search-wrap,
.clothes-search-wrap,
.vehicle-search-wrap {
    position: relative;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.search-item:hover {
    background: rgba(88, 101, 242, 0.12);
}

.search-item img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
}

.agreement-list {
    display: grid;
    gap: 0.5rem;
}

.agreement-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.agreement-row:hover {
    border-color: rgba(88, 101, 242, 0.4);
    background: rgba(88, 101, 242, 0.06);
}

.agreement-row-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.agreement-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(154, 164, 184, 0.15);
    color: var(--muted);
}

.status-active { background: rgba(87, 242, 135, 0.15); color: #9dffc0; }
.status-pending { background: rgba(254, 231, 92, 0.15); color: #ffe98a; }
.status-pending_close { background: rgba(254, 231, 92, 0.15); color: #ffe98a; }
.status-completed { background: rgba(154, 164, 184, 0.15); color: var(--muted); }
.status-rejected,
.status-cancelled { background: rgba(237, 66, 69, 0.15); color: #ffb4b5; }

.item-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.item-preview {
    max-width: 120px;
    border-radius: 8px;
}

.simple-list {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--muted);
}

.simple-list li {
    margin-bottom: 0.35rem;
}

.alert-list {
    margin: 0;
    padding-left: 1.25rem;
}

.alert-list li {
    margin-bottom: 0.5rem;
}

.detail-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.detail-list div {
    display: grid;
    gap: 0.2rem;
}

.detail-list dt {
    color: var(--muted);
    font-size: 0.85rem;
}

.detail-list dd {
    margin: 0;
}

.action-buttons {
    display: grid;
    gap: 0.75rem;
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
}

.extension-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .cabinet {
        grid-template-columns: 1fr;
    }

    .cabinet-sidebar {
        position: static;
    }

    .cabinet-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* Cabinet UX polish */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fade-in 0.35s ease-out;
}

.cabinet-lead {
    color: var(--muted);
    margin: -0.75rem 0 1.25rem;
    line-height: 1.6;
}

.discord-link {
    color: #7b86ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.discord-link:hover {
    color: #a5adff;
    text-decoration: underline;
}

.inline-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.inline-link:hover {
    text-decoration: underline;
}

.alert-warn {
    background: rgba(254, 231, 92, 0.12);
    border: 1px solid rgba(254, 231, 92, 0.35);
    color: #ffe98a;
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
}

.form-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.85rem;
    align-items: start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.form-step:last-of-type {
    border-bottom: none;
}

.step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.2);
    color: #b8bfff;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.35rem;
}

.field-hint {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.form-card h2 {
    margin-bottom: 0.35rem;
}

.empty-state {
    text-align: center;
    padding: 1.5rem 1rem;
    color: var(--muted);
}

.empty-state p {
    margin: 0 0 0.35rem;
}

.hover-lift {
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.hover-lift:hover {
    transform: translateY(-1px);
}

.agreement-row-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agreement-row-wrap .agreement-row {
    flex: 1;
}

.cancel-form {
    flex-shrink: 0;
}

.record-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.record-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.record-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: rgba(88, 101, 242, 0.55);
    box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
}

/* === Overhaul: background, home, modals, tools === */
.bg-orbs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

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

.orb-1 {
    width: 420px;
    height: 420px;
    background: #5865f2;
    top: -10%;
    left: -5%;
    animation-duration: 22s;
}

.orb-2 {
    width: 320px;
    height: 320px;
    background: #57f287;
    bottom: 10%;
    right: -5%;
    animation-delay: -6s;
    animation-duration: 26s;
}

.orb-3 {
    width: 280px;
    height: 280px;
    background: #eb459e;
    top: 40%;
    left: 50%;
    animation-delay: -12s;
    animation-duration: 20s;
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(45px, -35px) scale(1.12); }
    66% { transform: translate(-30px, 25px) scale(0.95); }
}

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

.card {
    backdrop-filter: blur(12px);
    background: rgba(29, 35, 48, 0.82);
}

.logo-mark {
    font-size: 1.4rem;
    color: var(--accent);
}

.login-hero {
    padding: 3rem 1rem;
}

.login-tagline {
    font-size: 1.35rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.btn-glow:hover {
    box-shadow: 0 0 24px rgba(88, 101, 242, 0.45);
}

.home-grid {
    display: grid;
    gap: 1rem;
}

.home-top-row {
    display: grid;
    gap: 1rem;
}

@media (min-width: 900px) {
    .home-top-row {
        grid-template-columns: 1.4fr 1fr;
        align-items: stretch;
    }
}

.user-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.guild-strip {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.guild-icon-sm {
    width: 56px;
    height: 56px;
    border-radius: 12px;
}

.guild-strip-body {
    display: grid;
    gap: 0.35rem;
}

.guild-strip-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.role-more {
    cursor: pointer;
    border: 1px dashed rgba(88, 101, 242, 0.5);
    background: transparent;
}

.role-tags-extra {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.home-title {
    margin: 0;
    font-size: 1.75rem;
}

.role-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.role-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.2);
    color: #b8bfff;
}

.guild-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.guild-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
}

.guild-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.guild-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.online-pulse .stat-value {
    color: #57f287;
}

.quick-links {
    display: grid;
    gap: 0.5rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.quick-link:hover {
    border-color: rgba(88, 101, 242, 0.5);
    background: rgba(88, 101, 242, 0.08);
}

.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.page-toolbar .cabinet-heading {
    margin-bottom: 0;
}

.toolbar-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal {
    border: none;
    border-radius: 18px;
    padding: 0;
    max-width: 560px;
    width: calc(100% - 2rem);
    background: var(--card);
    color: var(--text);
    box-shadow: var(--shadow);
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.modal-inner {
    padding: 1.5rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.summary-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.summary-row a {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}

.summary-row a:hover {
    border-color: rgba(88, 101, 242, 0.4);
}

.keys-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.summary-sections {
    display: grid;
    gap: 1rem;
}

.stagger-item {
    animation: fade-in 0.4s ease-out both;
}

.stagger-item:nth-child(2) { animation-delay: 0.05s; }
.stagger-item:nth-child(3) { animation-delay: 0.1s; }
.stagger-item:nth-child(4) { animation-delay: 0.15s; }

.pulse-badge {
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.modal {
    overflow: visible;
}

.member-search-wrap.dropdown-open,
.clothes-search-wrap.dropdown-open,
.vehicle-search-wrap.dropdown-open,
.unified-search-wrap.dropdown-open {
    z-index: 50;
    position: relative;
}

.search-results {
    z-index: 1000;
    top: calc(100% + 4px);
}

.vehicle-preview,
.item-preview.hidden {
    display: none;
}

.vehicle-preview:not(.hidden) {
    display: block;
    max-width: 160px;
    margin-top: 0.5rem;
    border-radius: 8px;
}

.record-list {
    display: grid;
    gap: 0.5rem;
}

.record-card {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    min-width: 0;
}

.record-card-sm {
    padding: 0.65rem 0.85rem;
}

.record-card-hit {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 12px;
}

.record-card-content {
    position: relative;
    z-index: 2;
    min-width: 0;
    display: grid;
    gap: 0.35rem;
}

.record-primary,
.record-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.record-discord-btn {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--accent);
    text-decoration: none;
    background: rgba(88, 101, 242, 0.08);
}

.record-card-actions {
    position: relative;
    z-index: 3;
}

.toast-stack {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(420px, calc(100% - 2rem));
    pointer-events: none;
}

.toast {
    padding: 0.85rem 1.1rem;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: rgba(87, 242, 135, 0.95);
    color: #0d2818;
}

.toast-error {
    background: rgba(237, 66, 69, 0.95);
    color: #fff;
}

.toast-warn {
    background: rgba(254, 231, 92, 0.95);
    color: #3d3000;
}

.toast-info {
    background: rgba(88, 101, 242, 0.95);
    color: #fff;
}

.confirm-modal {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0;
    background: var(--card);
    color: var(--text);
    max-width: 420px;
}

.confirm-modal::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.confirm-inner {
    padding: 1.25rem;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    position: relative;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--muted);
    transition: transform 0.2s, background 0.2s;
}

.toggle-switch.active {
    background: rgba(88, 101, 242, 0.35);
    border-color: rgba(88, 101, 242, 0.6);
}

.toggle-switch.active::after {
    transform: translateX(20px);
    background: var(--accent);
}

.bp-sticky-bar {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 1rem auto 0;
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(88, 101, 242, 0.35);
    background: rgba(29, 35, 48, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    z-index: 20;
}

.bp-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.bp-edit-controls {
    margin-top: 0.5rem;
}

.bp-cat-drag,
.task-drag {
    cursor: grab;
    color: var(--muted);
    margin-right: 0.35rem;
}

.task-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.admin-page {
    display: grid;
    gap: 1rem;
}

.admin-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 800px) {
    .admin-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.admin-compact h2 {
    margin-top: 0;
}

.admin-form-grid {
    display: grid;
    gap: 0.5rem;
}

.admin-input,
.admin-select {
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    font: inherit;
}

.drag-handle {
    cursor: grab;
    color: var(--muted);
}

.readonly-field {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--muted);
    width: 100%;
}

.hidden {
    display: none !important;
}

.confetti-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 200;
    animation: confetti-fly 0.75s ease-out forwards;
}

@keyframes confetti-fly {
    to {
        transform: translate(var(--dx), var(--dy));
        opacity: 0;
    }
}

.tool-page {
    display: grid;
    gap: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}

.tool-header h1 {
    margin: 0;
    font-size: 1.75rem;
}

.bp-stats {
    margin-bottom: 0;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.toggle-label {
    flex: 1;
    font-size: 0.9rem;
}

.bp-input-sm {
    max-width: 120px;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
}

.bp-category-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    background: transparent;
    border: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
}

.bp-category-body {
    padding: 0 1rem 1rem;
}

.bp-category-body.collapsed {
    display: none;
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}

.task-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem;
    transition: border-color 0.2s, transform 0.2s;
}

.task-card.completed {
    border-color: rgba(87, 242, 135, 0.4);
    background: rgba(87, 242, 135, 0.06);
}

.task-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
}

.task-bp {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(88, 101, 242, 0.25);
}

.task-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.task-card.completed .task-check {
    background: #2e8b57;
    border-color: #3cb371;
}

.completed-animation {
    animation: completed-pop 0.45s ease;
}

@keyframes completed-pop {
    50% { transform: scale(1.03); }
}

.counter-section {
    margin-top: 0.65rem;
    padding: 0.65rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.85rem;
}

.counter-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.skill-input {
    width: 56px;
    padding: 0.35rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text);
    text-align: center;
}

.game-hours-card {
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.skill-card h3 {
    margin-top: 0;
    font-size: 1rem;
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #7b86ff);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--muted);
}

.time-value {
    color: #57f287;
    font-weight: 600;
}

.maxed-skill {
    border-color: rgba(87, 242, 135, 0.45);
}

.max-level-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #2e8b57;
    color: white;
}

.recommended-skill {
    border-color: #4fd1c5;
    box-shadow: 0 0 12px rgba(79, 209, 197, 0.25);
}

.recommendations-container h3 {
    margin-top: 0;
}

.recommendations-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.recommendation-item {
    padding: 0.65rem 1rem;
    border-radius: 10px;
    background: rgba(79, 209, 197, 0.12);
    border: 1px solid rgba(79, 209, 197, 0.35);
}

.vip-toggle-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.hidden {
    display: none !important;
}

.alert-warn-inline {
    padding: 0.65rem;
    border-radius: 8px;
    background: rgba(254, 231, 92, 0.1);
}

.admin-section {
    margin-top: 1rem;
}

.admin-bp-cat {
    margin: 1rem 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.admin-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.admin-task-list {
    list-style: none;
    margin: 0.5rem 0;
    padding: 0;
    font-size: 0.9rem;
}

.admin-task-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
}

.admin-num {
    width: 64px;
}

@media (prefers-reduced-motion: reduce) {
    .orb, .pulse-badge, .stagger-item, .confetti-particle {
        animation: none;
    }
}

@media (max-width: 640px) {
    .keys-summary-grid {
        grid-template-columns: 1fr;
    }

    .nav {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 0.85rem;
    }
}
