:root {
    --bk-primary: #6f42c1;
    --bk-primary-dark: #4b2a8a;
    --bk-primary-soft: #f1ebff;
    --bk-accent: #ffb703;
    --bk-ink: #211a33;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a {
    text-decoration: none;
}

.min-w-0 {
    min-width: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(140deg, var(--bk-primary), #a06bff 65%, var(--bk-accent));
    box-shadow: 0 10px 24px rgba(111, 66, 193, 0.35);
    font-size: 1.35rem;
}

.brand-mark-sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 1rem;
    box-shadow: none;
}

.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--bk-primary), #a06bff);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.avatar-circle-sm {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 0.8rem;
}

.app-sidebar {
    background: linear-gradient(180deg, #241b38 0%, #191226 100%) !important;
}

.sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.sidebar-brand .brand-link {
    color: #fff;
    gap: 0.65rem;
}

.sidebar-user-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-panel .avatar-circle {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.sidebar-menu .nav-header {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 1rem 1rem 0.35rem;
}

.sidebar-menu .nav-link {
    color: rgba(255, 255, 255, 0.74);
    border-radius: 0.55rem;
    margin: 0.1rem 0.65rem;
    padding: 0.55rem 0.65rem;
}

.sidebar-menu .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-menu .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(111, 66, 193, 0.95), rgba(160, 107, 255, 0.65));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.sidebar-menu .nav-icon {
    width: 1.4rem;
    margin-right: 0.35rem;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.app-header {
    backdrop-filter: blur(8px);
}

.app-content-header h3 {
    letter-spacing: -0.02em;
}

.card {
    border: 0;
    box-shadow: 0 8px 28px rgba(33, 26, 51, 0.07);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--bs-border-color-translucent);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 140px;
    height: 140px;
    right: -65px;
    top: -70px;
    border-radius: 50%;
    background: var(--bk-primary-soft);
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 1.15rem;
    color: var(--bk-primary);
    background: var(--bk-primary-soft);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
}

.stat-label {
    color: var(--bs-secondary-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.metric-mini {
    font-size: 0.82rem;
    color: var(--bs-secondary-color);
}

.trend-row {
    display: grid;
    grid-template-columns: 62px 1fr 36px;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
}

.trend-row .progress {
    height: 8px;
}

.trend-row .progress-bar {
    background: linear-gradient(90deg, var(--bk-primary), #a06bff);
}

.table > :not(caption) > * > * {
    padding: 0.7rem 0.65rem;
    vertical-align: middle;
}

.table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    font-weight: 600;
    white-space: nowrap;
}

.btn-primary {
    --bs-btn-bg: var(--bk-primary);
    --bs-btn-border-color: var(--bk-primary);
    --bs-btn-hover-bg: var(--bk-primary-dark);
    --bs-btn-hover-border-color: var(--bk-primary-dark);
    --bs-btn-active-bg: var(--bk-primary-dark);
    --bs-btn-active-border-color: var(--bk-primary-dark);
}

.btn-outline-primary {
    --bs-btn-color: var(--bk-primary);
    --bs-btn-border-color: var(--bk-primary);
    --bs-btn-hover-bg: var(--bk-primary);
    --bs-btn-hover-border-color: var(--bk-primary);
    --bs-btn-active-bg: var(--bk-primary);
    --bs-btn-active-border-color: var(--bk-primary);
}

.text-brand {
    color: var(--bk-primary) !important;
}

.bg-brand-soft {
    background: var(--bk-primary-soft) !important;
}

.form-label {
    font-weight: 600;
    font-size: 0.82rem;
}

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 183, 3, 0.2), transparent 30%),
        radial-gradient(circle at 88% 18%, rgba(160, 107, 255, 0.28), transparent 34%),
        linear-gradient(145deg, #1a1229 0%, #2a1b45 52%, #160f24 100%);
    color: #fff;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 1.15rem;
}

.auth-card {
    width: min(100%, 440px);
    border-radius: 1.25rem;
    overflow: hidden;
}

.auth-card-wide {
    width: min(100%, 620px);
}

.auth-card .form-control {
    border-radius: 0.7rem;
}

.auth-card .btn {
    border-radius: 0.7rem;
}

.auth-illustration {
    width: 100%;
    max-width: 170px;
    image-rendering: pixelated;
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.5rem;
}

.shared-key {
    display: block;
    padding: 0.65rem 0.8rem;
    border-radius: 0.6rem;
    background: #f5f2fb;
    color: var(--bk-ink);
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    word-break: break-all;
}

.recovery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.recovery-grid code {
    display: block;
    padding: 0.55rem 0.65rem;
    border-radius: 0.5rem;
    background: #f5f2fb;
    color: var(--bk-ink);
    text-align: center;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.code-block {
    max-height: 28rem;
    overflow: auto;
    background: #1b1526;
    color: #e9e4f5;
    border-radius: 0.65rem;
    padding: 0.9rem;
    font-size: 0.78rem;
    margin-bottom: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.detail-list dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    font-weight: 600;
}

.detail-list dd {
    margin-bottom: 0.85rem;
}

.empty-state {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--bs-secondary-color);
}

.empty-state i {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

@media (max-width: 575.98px) {
    .auth-shell {
        justify-content: flex-start;
        padding-top: 2.5rem;
    }

    .recovery-grid {
        grid-template-columns: 1fr;
    }

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