:root {
    --primary: #5B4FE9;
    --primary-600: #4D41DA;
    --primary-700: #3F34BF;
    --primary-400: #7D72F2;
    --primary-200: #D3CEFF;
    --primary-100: #E9E6FF;
    --primary-50: #F4F2FF;
    --bg: #F5F5FA;
    --surface: #FFFFFF;
    --border: #ECEAF4;
    --border-strong: #DCD9EA;
    --text: #17162B;
    --text-2: #4A4866;
    --muted: #8D8AA6;
    --success: #1E9E64;
    --success-bg: #E5F6EE;
    --warning: #E5850B;
    --warning-bg: #FFF2DF;
    --danger: #E0474C;
    --danger-bg: #FDECEC;
    --radius-xl: 18px;
    --radius-lg: 14px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(23, 22, 43, .04);
    --shadow: 0 1px 2px rgba(23, 22, 43, .04), 0 8px 24px -14px rgba(46, 38, 128, .14);
    --shadow-lg: 0 18px 36px -20px rgba(46, 38, 128, .26);
    --shadow-primary: 0 10px 22px -10px rgba(91, 79, 233, .5);
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    font-feature-settings: 'cv11', 'ss01';
    letter-spacing: -.005em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@supports not selector(::-webkit-scrollbar) {
    * {
        scrollbar-width: thin;
        scrollbar-color: var(--border-strong) transparent;
    }
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    min-height: 36px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--border-strong) padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-200);
}

::-webkit-scrollbar-thumb:active {
    background-color: var(--primary-400);
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border);
}

.sidebar:hover::-webkit-scrollbar-thumb {
    background-color: var(--border-strong);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-200);
}

.sidebar::-webkit-scrollbar-thumb:active {
    background-color: var(--primary-400);
}

input, select, textarea {
    font-family: inherit;
}

h1, h2, h3, p {
    margin: 0;
}

h1:focus {
    outline: none;
}

a {
    color: var(--primary);
    text-decoration: none;
}

button {
    font: inherit;
}

.icon {
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    height: 36px;
    padding: 0 .95rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: .88rem;
    cursor: pointer;
    transition: background-color .15s, box-shadow .15s, transform .15s, color .15s;
    white-space: nowrap;
}

.btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-100);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-600) 100%);
    color: #fff;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
}

.btn-soft {
    background: var(--primary-50);
    color: var(--primary);
}

.btn-soft:hover:not(:disabled) {
    background: var(--primary-100);
}

.btn-lg {
    height: 42px;
    font-size: .93rem;
    border-radius: 11px;
}

.btn-block {
    width: 100%;
}

.spinner {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid var(--primary-100);
    border-top-color: var(--primary);
    animation: spin .8s linear infinite;
}

.spinner-light {
    border-color: rgba(255, 255, 255, .35);
    border-top-color: #fff;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .12rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    white-space: nowrap;
}

.pill-primary {
    background: var(--primary-50);
    color: var(--primary);
}

.pill-success {
    background: var(--success-bg);
    color: var(--success);
}

.pill-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.pill-neutral {
    background: #F1F0F6;
    color: var(--text-2);
}

.pill-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-400), var(--primary));
    color: #fff;
    font-weight: 700;
    font-size: .72rem;
    letter-spacing: .02em;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--primary-100);
}

.avatar-lg {
    width: 42px;
    height: 42px;
    font-size: .9rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .1rem .45rem 1.2rem;
    color: var(--text);
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-glyph {
    display: block;
    flex-shrink: 0;
}

.brand-mark-sm {
    width: 34px;
    height: 34px;
}

.brand-mark-light {
    filter: drop-shadow(0 2px 6px rgba(20, 12, 90, .25));
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-weight: 800;
    font-size: 1.12rem;
    letter-spacing: -.02em;
    line-height: 1.1;
}

.brand-name-accent {
    color: var(--primary);
    font-weight: 800;
}

.sidebar .brand-name {
    font-size: 1.32rem;
}

.auth-art-brand .brand-name-accent {
    color: rgba(255, 255, 255, .78);
}

.brand-sub {
    font-size: .64rem;
    line-height: 1.3;
    margin-top: .12rem;
    color: var(--muted);
    font-weight: 500;
}

.shell {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns .2s ease;
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding-bottom: 1.2rem;
}

.sidebar-top .brand {
    flex: 1;
    min-width: 0;
    padding-bottom: 0;
}

.sidebar {
    overflow-x: hidden;
}

.sidebar .brand-text,
.sidebar .nav-link,
.sidebar .nav-label {
    white-space: nowrap;
}

.sidebar .brand-text {
    overflow: hidden;
}

.sidebar-toggle {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s, transform .1s;
}

.sidebar-toggle:hover {
    background: var(--primary-50);
    border-color: var(--primary-100);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle:active {
    transform: scale(.94);
}

.sidebar-toggle:focus-visible {
    outline: none;
    border-color: var(--primary-200);
    box-shadow: 0 0 0 3px var(--primary-100);
    color: var(--primary);
}

@media (min-width: 961px) {
    html.sidebar-collapsed .shell {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    html.sidebar-collapsed .sidebar {
        padding-inline: .6rem;
    }

    html.sidebar-collapsed .sidebar-top {
        flex-direction: column;
        gap: .65rem;
    }

    html.sidebar-collapsed .sidebar-top .brand {
        flex: none;
        justify-content: center;
        padding: 0;
    }

    html.sidebar-collapsed .brand-text {
        display: none;
    }

    html.sidebar-collapsed .nav-label {
        height: 1px;
        margin: .75rem .55rem .55rem;
        padding: 0;
        overflow: hidden;
        font-size: 0;
        background: var(--border);
    }

    html.sidebar-collapsed .sidebar-top + .nav-label {
        margin-top: 0;
        background: transparent;
    }

    html.sidebar-collapsed .nav-link {
        justify-content: center;
        gap: 0;
        padding: .55rem 0;
    }

    html.sidebar-collapsed .nav-link span {
        display: none;
    }
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.15rem .8rem;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.nav-label {
    padding: 0 .7rem .4rem;
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
}

.nav {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .7rem;
    border-radius: 9px;
    color: var(--text-2);
    font-weight: 600;
    font-size: .88rem;
    transition: background-color .15s, color .15s;
}

.nav-link:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary-50);
    color: var(--primary);
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-foot {
    margin-top: auto;
    padding: .75rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--primary-50), #fff);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    min-width: 0;
}

.sidebar-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: .84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-mail {
    font-size: .72rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 58px;
    width: 100%;
    max-width: 1220px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: 0 1.6rem;
    background: rgba(245, 245, 250, .86);
    backdrop-filter: blur(12px);
}

.topbar-brand {
    display: none;
    align-items: center;
    gap: .55rem;
    color: var(--text);
}

.topbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.topbar-user-text {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}

.topbar-user-name {
    font-weight: 600;
    font-size: .84rem;
}

.topbar-user-role {
    font-size: .7rem;
    color: var(--muted);
}

.content {
    width: 100%;
    max-width: 1220px;
    margin-inline: auto;
    padding: .25rem 1.6rem 2.2rem;
}

.bottom-nav {
    display: none;
}

.page-head {
    margin-bottom: 1.1rem;
}

.page-head h1 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.page-head p {
    color: var(--muted);
    font-size: .88rem;
    margin-top: .1rem;
}

.greeting {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.1rem;
}

.greeting h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
}

.greeting p {
    color: var(--muted);
    font-weight: 500;
    font-size: .86rem;
}

.hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-xl);
    color: #fff;
    background: linear-gradient(125deg, #4D41DA 0%, #5B4FE9 45%, #8576FA 100%);
    box-shadow: var(--shadow-primary);
    margin-bottom: 1.4rem;
}

.hero::before, .hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.hero::before {
    width: 260px;
    height: 260px;
    right: -40px;
    top: -140px;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%);
}

.hero::after {
    width: 200px;
    height: 200px;
    left: 34%;
    bottom: -150px;
    background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%);
}

.hero-body {
    position: relative;
    z-index: 1;
    align-self: center;
}

.hero-eyebrow {
    font-size: .78rem;
    font-weight: 600;
    opacity: .85;
}

.hero-value {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.15;
    margin: .1rem 0 .2rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: 0;
}

.hero-sub {
    opacity: .85;
    font-size: .84rem;
}

.hero-stats {
    display: flex;
    gap: 1.6rem;
    margin-top: .85rem;
}

.hero-stats div {
    display: flex;
    flex-direction: column;
}

.hero-stat-value {
    font-size: .98rem;
    font-weight: 700;
}

.hero-stat-label {
    font-size: .64rem;
    opacity: .78;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.hero-art {
    position: relative;
    z-index: 1;
    width: 190px;
    margin: 0 0 -.7rem 0;
    filter: drop-shadow(0 14px 18px rgba(23, 16, 90, .32));
}

.section {
    margin-bottom: 1.4rem;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .7rem;
}

.section-head h2, .card-head h2 {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .8rem;
    font-weight: 600;
}

.link:hover {
    color: var(--primary-700);
}

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: .75rem;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
    padding: .9rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform .15s, box-shadow .15s;
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.tile-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    color: var(--primary);
}

.tile-name {
    font-weight: 600;
    font-size: .88rem;
}

.tile-meta {
    font-size: .76rem;
    color: var(--muted);
}

.tile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
}

.tile-accent {
    background: linear-gradient(160deg, var(--primary-50), #fff 70%);
    border-color: var(--primary-100);
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.card {
    padding: 1.05rem 1.1rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    margin-bottom: .75rem;
}

.card-count {
    min-width: 24px;
    height: 24px;
    padding: 0 .45rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 700;
    font-size: .76rem;
}

.card-empty {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.card-empty strong {
    font-size: .9rem;
}

.card-empty p {
    color: var(--muted);
    font-size: .82rem;
}

.timeline {
    list-style: none;
    margin: 0 0 .9rem;
    padding: 0;
}

.timeline li {
    position: relative;
    display: flex;
    gap: .75rem;
    padding: .5rem .6rem;
    border-radius: 10px;
}

.timeline li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: calc(.6rem + 8px);
    top: calc(.5rem + 18px);
    bottom: calc(-.5rem + 2px);
    width: 2px;
    background: var(--border-strong);
}

.timeline li.timeline-done:not(:last-child)::after {
    background: var(--primary);
}

.timeline-dot {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid var(--border-strong);
    color: #fff;
}

.timeline-done .timeline-dot {
    background: var(--primary);
    border-color: var(--primary);
}

.timeline-current {
    background: var(--primary-50);
}

.timeline-current .timeline-dot {
    border: 2px solid var(--primary);
    box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 8px var(--primary);
}

.timeline li div {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.timeline strong {
    font-size: .84rem;
    font-weight: 600;
}

.timeline span:not(.timeline-dot) {
    font-size: .74rem;
    color: var(--muted);
}

.status {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .75rem;
    padding: .55rem .75rem;
    border-radius: 10px;
    font-size: .8rem;
    font-weight: 600;
}

.status-ok {
    background: var(--success-bg);
    color: var(--success);
}

.status-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.list-row {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem 0;
}

.list-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.list-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    color: var(--primary);
}

.list-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
    margin-right: auto;
}

.list-text strong {
    font-size: .86rem;
    font-weight: 600;
}

.list-text span {
    font-size: .72rem;
    color: var(--muted);
}

.list-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .25rem;
}

.list-empty {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .2rem 0;
    color: var(--muted);
    font-size: .82rem;
}

.empty-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    color: var(--primary);
}

.empty-icon-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .28rem .6rem;
    border-radius: 999px;
    background: #F4F3F9;
    border: 1px solid var(--border);
    font-size: .76rem;
    font-weight: 600;
    color: var(--text-2);
}

.chip-code {
    color: var(--muted);
    font-weight: 500;
    font-family: ui-monospace, Consolas, monospace;
    font-size: .7rem;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: 1rem;
    background: linear-gradient(120deg, #fff 55%, var(--primary-50));
}

.profile-main h2 {
    font-size: 1.08rem;
    font-weight: 700;
}

.profile-mail {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--muted);
    font-size: .82rem;
}

.profile-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .45rem;
}

.details {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.detail {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .7rem .8rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.detail div {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.detail-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    color: var(--primary);
}

.detail-label {
    font-size: .7rem;
    color: var(--muted);
    font-weight: 600;
}

.detail-value {
    font-weight: 700;
    font-size: .88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skeleton-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.skeleton {
    background: linear-gradient(90deg, #EFEDF6 0%, #F7F6FB 50%, #EFEDF6 100%);
    background-size: 200% 100%;
    animation: shimmer 1.3s ease-in-out infinite;
    border-radius: 8px;
}

.skeleton-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.skeleton-line {
    height: 12px;
    width: 50%;
}

.skeleton-line-short {
    width: 30%;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

.empty-state {
    max-width: 400px;
    margin: 3rem auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    padding: 0 1rem;
}

.empty-state .empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
}

.empty-state h1 {
    font-size: 1.2rem;
    font-weight: 700;
}

.empty-state p {
    color: var(--muted);
    font-size: .88rem;
    margin-bottom: .5rem;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding: .6rem .8rem;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 600;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.page-loader {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1.25rem;
    background:
        radial-gradient(600px 420px at 12% 18%, rgba(125, 114, 242, .16), transparent 70%),
        radial-gradient(520px 380px at 88% 82%, rgba(91, 79, 233, .12), transparent 70%),
        var(--bg);
}

.auth-shell {
    width: min(900px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 480px;
    padding: .55rem;
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 30px 60px -30px rgba(46, 38, 128, .35), 0 2px 6px rgba(23, 22, 43, .04);
}

.auth-art {
    position: relative;
    overflow: hidden;
    padding: 1.5rem 1.6rem;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(155deg, #3F34BF 0%, #5B4FE9 52%, #8B7CFB 100%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-art::before {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    right: -120px;
    top: -130px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%);
}

.auth-art::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    left: -110px;
    bottom: -120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%);
}

.auth-art > * {
    position: relative;
    z-index: 1;
}

.auth-art-brand {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.auth-art-brand .brand-name {
    font-size: 1.05rem;
}

.auth-art-brand .brand-sub {
    color: rgba(255, 255, 255, .8);
}

.auth-eyebrow {
    display: inline-block;
    padding: .18rem .6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: .6rem;
}

.auth-art h2 {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.02em;
}

.auth-art p {
    margin-top: .4rem;
    font-size: .82rem;
    opacity: .82;
}

.auth-visual {
    position: relative;
    height: 160px;
    margin: auto 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.auth-route {
    position: absolute;
    inset: 0 0 auto 0;
    width: 100%;
    height: 70px;
    opacity: .7;
}

.auth-truck {
    width: 200px;
    filter: drop-shadow(0 12px 16px rgba(18, 12, 80, .38));
}

.float-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .32rem .6rem .32rem .35rem;
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-size: .7rem;
    font-weight: 600;
    box-shadow: 0 10px 20px -10px rgba(18, 12, 80, .45);
}

.float-badge-icon {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.float-badge-success .float-badge-icon {
    background: var(--success-bg);
    color: var(--success);
}

.float-badge-primary .float-badge-icon {
    background: var(--primary-50);
    color: var(--primary);
}

.float-badge-top {
    top: 4px;
    right: 6px;
}

.float-badge-bottom {
    left: 0;
    bottom: 34px;
}

.auth-visual {
    --auth-loop: 12s;
}

.auth-route-progress {
    stroke-dasharray: 100 100;
    stroke-dashoffset: 100;
    animation: auth-route-draw var(--auth-loop) linear infinite;
}

.auth-route-dot {
    offset-path: path("M17 56 C 98 6, 183 70, 256 30 S 354 10, 373 18");
    offset-rotate: 0deg;
    opacity: 0;
    animation: auth-route-dot var(--auth-loop) linear infinite;
}

.auth-visual .float-badge-bottom {
    animation:
        auth-badge-transit var(--auth-loop) ease infinite,
        auth-badge-float 2.6s ease-in-out infinite alternate;
}

.auth-visual .float-badge-top {
    animation:
        auth-badge-delivered var(--auth-loop) ease infinite,
        auth-badge-float 2.2s ease-in-out infinite alternate;
}

.truck-animated .truck-wheel,
.truck-animated .truck-puff {
    transform-box: fill-box;
    transform-origin: center;
}

.truck-animated .truck-wheel {
    animation: truck-wheel var(--auth-loop) linear infinite;
}

.truck-animated .truck-road {
    animation: truck-road var(--auth-loop) linear infinite;
}

.truck-animated .truck-body {
    animation: truck-bounce .42s ease-in-out infinite alternate;
}

.truck-animated .truck-exhaust {
    opacity: 0;
    animation: truck-exhaust var(--auth-loop) linear infinite;
}

.truck-animated .truck-puff {
    opacity: 0;
    animation: truck-puff 1.2s ease-out infinite;
}

.truck-animated .truck-puff:nth-child(2) {
    animation-delay: .4s;
}

.truck-animated .truck-puff:nth-child(3) {
    animation-delay: .8s;
}

.truck-animated .truck-parcel-top {
    animation: truck-parcel-top var(--auth-loop) linear infinite;
}

.truck-animated .truck-parcel-bottom {
    animation: truck-parcel-bottom var(--auth-loop) linear infinite;
}

.auth-art::before {
    animation: auth-glow 9s ease-in-out infinite alternate;
}

.auth-art-brand,
.auth-art-body,
.auth-visual,
.auth-features,
.auth-card {
    animation: auth-rise .6s cubic-bezier(.2, .7, .2, 1) both;
}

.auth-art-body {
    animation-delay: .08s;
}

.auth-visual {
    animation-delay: .16s;
}

.auth-features {
    animation-delay: .24s;
}

.auth-card {
    animation-delay: .1s;
}

.auth-form .btn-primary .icon {
    transition: transform .2s ease;
}

.auth-form .btn-primary:not(:disabled):hover .icon {
    transform: translateX(3px);
}

@keyframes auth-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes auth-glow {
    to {
        transform: translate(-24px, 16px) scale(1.12);
    }
}

@keyframes auth-route-draw {
    0%, 20% {
        stroke-dashoffset: 100;
        opacity: 1;
    }

    78%, 92% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    98% {
        stroke-dashoffset: 0;
        opacity: 0;
    }

    100% {
        stroke-dashoffset: 100;
        opacity: 0;
    }
}

@keyframes auth-route-dot {
    0%, 18% {
        offset-distance: 0%;
        opacity: 0;
    }

    20% {
        offset-distance: 0%;
        opacity: 1;
    }

    78% {
        offset-distance: 100%;
        opacity: 1;
    }

    81%, 100% {
        offset-distance: 100%;
        opacity: 0;
    }
}

@keyframes auth-badge-transit {
    0%, 18% {
        opacity: 0;
        scale: .85;
    }

    21%, 77% {
        opacity: 1;
        scale: 1;
    }

    81%, 100% {
        opacity: 0;
        scale: .95;
    }
}

@keyframes auth-badge-delivered {
    0%, 77% {
        opacity: 0;
        scale: .8;
    }

    80% {
        opacity: 1;
        scale: 1.07;
    }

    82%, 93% {
        opacity: 1;
        scale: 1;
    }

    98%, 100% {
        opacity: 0;
        scale: .95;
    }
}

@keyframes auth-badge-float {
    to {
        translate: 0 -4px;
    }
}

@keyframes truck-wheel {
    0%, 20% {
        transform: rotate(0deg);
        animation-timing-function: ease-in;
    }

    28% {
        transform: rotate(360deg);
        animation-timing-function: linear;
    }

    78% {
        transform: rotate(5760deg);
        animation-timing-function: ease-out;
    }

    86%, 100% {
        transform: rotate(6120deg);
    }
}

@keyframes truck-road {
    0%, 20% {
        stroke-dashoffset: 0;
        animation-timing-function: ease-in;
    }

    28% {
        stroke-dashoffset: 94;
        animation-timing-function: linear;
    }

    78% {
        stroke-dashoffset: 1504;
        animation-timing-function: ease-out;
    }

    86%, 100% {
        stroke-dashoffset: 1612;
    }
}

@keyframes truck-bounce {
    to {
        transform: translateY(-1px);
    }
}

@keyframes truck-exhaust {
    0%, 21% {
        opacity: 0;
    }

    25%, 74% {
        opacity: .55;
    }

    80%, 100% {
        opacity: 0;
    }
}

@keyframes truck-puff {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(.5);
    }

    25% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-22px, -8px) scale(2);
    }
}

@keyframes truck-parcel-top {
    0%, 3% {
        transform: none;
        opacity: 1;
    }

    7% {
        transform: translate(16px, -12px);
        opacity: 1;
    }

    10% {
        transform: translate(38px, -4px);
        opacity: 1;
    }

    11%, 96% {
        transform: translate(38px, -4px);
        opacity: 0;
    }

    96.1% {
        transform: none;
        opacity: 0;
    }

    100% {
        transform: none;
        opacity: 1;
    }
}

@keyframes truck-parcel-bottom {
    0%, 9% {
        transform: none;
        opacity: 1;
    }

    13% {
        transform: translate(18px, -20px);
        opacity: 1;
    }

    16% {
        transform: translate(42px, -16px);
        opacity: 1;
    }

    17%, 94% {
        transform: translate(42px, -16px);
        opacity: 0;
    }

    94.1% {
        transform: none;
        opacity: 0;
    }

    98%, 100% {
        transform: none;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-art::before,
    .auth-art-brand,
    .auth-art-body,
    .auth-visual,
    .auth-features,
    .auth-card,
    .auth-route-progress,
    .auth-route-dot,
    .auth-visual .float-badge-top,
    .auth-visual .float-badge-bottom,
    .truck-animated * {
        animation: none !important;
    }
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.auth-features li {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .28rem .6rem .28rem .4rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
    font-size: .7rem;
    font-weight: 600;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.8rem 2rem;
}

.auth-card {
    width: 100%;
    max-width: 340px;
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1.4rem;
}

.auth-card h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth-hint {
    color: var(--muted);
    margin: .2rem 0 1.3rem;
    font-size: .84rem;
    font-weight: 500;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.auth-form .btn-lg {
    margin-top: .25rem;
}

.auth-foot {
    margin-top: 1.1rem;
    text-align: center;
    color: var(--muted);
    font-size: .74rem;
}

.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
    caret-color: var(--text);
    transition: background-color 9999s ease-out 0s;
}

.input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--surface) inset, 0 0 0 3px var(--primary-100);
}

.field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.field-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-2);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: .8rem;
    color: var(--muted);
    pointer-events: none;
}

.input {
    width: 100%;
    height: 40px;
    padding: 0 .85rem 0 2.35rem;
    border-radius: 10px;
    border: 1.5px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .88rem;
    font-weight: 500;
    transition: border-color .15s, box-shadow .15s;
}

.input::placeholder {
    color: #B2B0C6;
}

.input:hover:not(:disabled) {
    border-color: var(--primary-200);
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.input-wrap:focus-within .input-icon {
    color: var(--primary);
}

.input-has-action {
    padding-right: 2.6rem;
}

.input-action {
    position: absolute;
    right: .3rem;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.input-action:hover {
    background: var(--primary-50);
    color: var(--primary);
}

.input.invalid {
    border-color: var(--danger);
}

.validation-message {
    color: var(--danger);
    font-size: .74rem;
    font-weight: 600;
}

.boot {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
}

.boot-name {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -.02em;
    color: var(--text);
}

.boot-name .brand-name-accent {
    font-weight: 800;
}

.boot-sub {
    margin-top: -.5rem;
    font-size: .8rem;
    font-weight: 500;
    color: var(--text-2);
}

.boot-bar {
    width: 120px;
    height: 4px;
    border-radius: 999px;
    background: var(--primary-100);
    overflow: hidden;
}

.boot-bar span {
    display: block;
    width: 40%;
    height: 100%;
    border-radius: 999px;
    background: var(--primary);
    animation: boot 1.1s ease-in-out infinite;
}

@keyframes boot {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(250%);
    }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 1rem;
    z-index: 1000;
    transform: translateX(-50%);
    width: min(92vw, 480px);
    padding: .75rem 2.3rem .75rem 1rem;
    border-radius: 12px;
    background: var(--text);
    color: #fff;
    box-shadow: var(--shadow-lg);
    font-size: .85rem;
}

#blazor-error-ui .reload {
    color: var(--primary-200);
    font-weight: 600;
    margin-left: .5rem;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: .8rem;
    top: .55rem;
    cursor: pointer;
    font-size: 1.1rem;
}

.blazor-error-boundary {
    padding: .85rem 1rem;
    border-radius: 12px;
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 600;
}

.blazor-error-boundary::after {
    content: "Something went wrong here.";
}

@media (max-width: 1100px) {
    .details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 960px) {
    .shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        display: none;
    }

    .topbar {
        height: 54px;
        max-width: none;
        padding: 0 1rem;
        background: rgba(255, 255, 255, .9);
        border-bottom: 1px solid var(--border);
    }

    .topbar-brand {
        display: inline-flex;
    }

    .topbar-user-text {
        display: none;
    }

    .content {
        padding: 1rem 1rem 5.5rem;
    }

    .bottom-nav {
        position: fixed;
        left: .6rem;
        right: .6rem;
        bottom: .6rem;
        z-index: 30;
        display: flex;
        justify-content: space-around;
        padding: .35rem;
        border-radius: 16px;
        background: var(--surface);
        border: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
    }

    .bottom-link {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: .1rem;
        padding: .35rem 0;
        border: 0;
        border-radius: 11px;
        background: transparent;
        color: var(--muted);
        font-size: .68rem;
        font-weight: 600;
        cursor: pointer;
    }

    .bottom-link.active {
        color: var(--primary);
        background: var(--primary-50);
    }

    .hero {
        grid-template-columns: minmax(0, 1fr);
        padding: 1.1rem 1.2rem;
    }

    .hero-value {
        font-size: 1.8rem;
    }

    .hero-art {
        position: absolute;
        right: -1rem;
        bottom: -.4rem;
        width: 150px;
        opacity: .9;
    }

    .hero-body {
        padding-right: 7rem;
    }
}

@media (max-width: 860px) {
    .auth {
        place-items: start center;
        padding-top: 2.5rem;
    }

    .auth-shell {
        width: min(420px, 100%);
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .auth-art {
        display: none;
    }

    .auth-panel {
        padding: 1.6rem 1.3rem;
    }

    .auth-mobile-brand {
        display: flex;
    }
}

@media (max-width: 560px) {
    .details {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-body {
        padding-right: 0;
    }

    .hero-art {
        width: 120px;
        opacity: .35;
    }

    .profile-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .auth {
        padding: 1.5rem 1rem;
    }

    .auth-panel {
        padding: 1.4rem 1.1rem;
    }
}
