.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
    font-family: var(--font-brand);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: .02em
}

.brand-mark {
    width: 34px;
    height: 34px
}

.brand-accent {
    color: var(--accent)
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--primary);
    font-size: var(--text-sm);
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase
}

.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent)
}

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

.kicker {
    max-width: 640px;
    font-size: var(--text-lg);
    color: var(--muted)
}

.btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: .65rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: none;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition), border var(--transition), transform var(--transition)
}

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

.btn-primary {
    background: var(--accent);
    color: var(--black)
}

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

.btn-secondary {
    background: var(--primary);
    color: var(--white)
}

.btn-secondary:hover {
    background: var(--primary-hover)
}

.btn-outline {
    border-color: var(--border);
    background: var(--surface)
}

.btn-ghost:hover {
    background: var(--surface-2)
}

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

.btn-icon {
    width: 42px;
    padding: 0
}

.btn-sm {
    min-height: 34px;
    padding: .4rem .7rem;
    font-size: var(--text-sm)
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm)
}

.card-header,
.card-body,
.card-footer {
    padding: var(--space-5)
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4)
}

.card-header+.card-body {
    padding-top: 0
}

.card-footer {
    border-top: 1px solid var(--border)
}

.metric {
    padding: var(--space-5)
}

.metric-label {
    color: var(--muted);
    font-size: var(--text-sm)
}

.metric-value {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-2xl);
    font-weight: 800
}

.metric-foot {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    color: var(--muted)
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .22rem .55rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 750
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor
}

.badge-success {
    background: color-mix(in srgb, var(--success) 12%, var(--surface));
    color: var(--success)
}

.badge-warning {
    background: color-mix(in srgb, var(--warning) 12%, var(--surface));
    color: var(--warning)
}

.badge-danger {
    background: color-mix(in srgb, var(--danger) 12%, var(--surface));
    color: var(--danger)
}

.badge-blue {
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    color: var(--primary)
}

.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2)
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4)
}

label {
    font-size: var(--text-sm);
    font-weight: 700
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    padding: .68rem .8rem;
    transition: border var(--transition), box-shadow var(--transition)
}

.textarea {
    min-height: 100px;
    resize: vertical
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: var(--primary)
}

.field-hint {
    font-size: var(--text-xs);
    color: var(--muted)
}

.field-error {
    font-size: var(--text-xs);
    color: var(--danger)
}

[aria-invalid="true"] {
    border-color: var(--danger)
}

.alert {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    background: var(--surface)
}

.alert-success {
    border-left-color: var(--success)
}

.alert-danger {
    border-left-color: var(--danger)
}

.alert-warning {
    border-left-color: var(--warning)
}

.alert strong {
    display: block
}

.alert p {
    font-size: var(--text-sm);
    color: var(--muted)
}

.table-wrap {
    overflow: auto
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm)
}

.table th,
.table td {
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap
}

.table th {
    color: var(--muted);
    font-size: var(--text-xs);
    letter-spacing: .03em;
    text-transform: uppercase
}

.table tbody tr:hover {
    background: var(--surface-2)
}

.avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 15%, var(--surface));
    color: var(--primary);
    font-size: var(--text-sm);
    font-weight: 800
}

.person {
    display: flex;
    align-items: center;
    gap: var(--space-3)
}

.person-copy {
    display: flex;
    flex-direction: column
}

.person-copy small {
    color: var(--muted)
}

.progress {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-2);
    overflow: hidden
}

.progress-bar {
    height: 100%;
    border-radius: inherit;
    background: var(--accent)
}

.empty {
    display: flex;
    max-width: 480px;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    margin: auto;
    padding: var(--space-10);
    text-align: center
}

.empty-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    color: var(--primary);
    font-size: 1.5rem
}

.skeleton {
    height: 14px;
    border-radius: 999px;
    background: var(--surface-2);
    animation: pulse 1.4s ease infinite
}

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite
}

@keyframes pulse {
    50% {
        opacity: .45
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.modal {
    width: min(560px, calc(100% - 2rem));
    padding: 0;
    border: 0;
    border-radius: var(--radius-xl);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-md)
}

.modal::backdrop {
    background: rgba(0, 0, 0, .58)
}

.modal-head,
.modal-body,
.modal-foot {
    padding: var(--space-5)
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border)
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    border-top: 1px solid var(--border)
}

.toast-region {
    position: fixed;
    right: var(--space-5);
    bottom: var(--space-5);
    z-index: 50
}

.toast {
    max-width: 380px;
    padding: var(--space-4);
    border: 1px solid var(--border);
    border-left: 4px solid var(--success);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-md)
}

.stepper {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
    padding: 0;
    margin: 0
}

.step {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--muted);
    font-size: var(--text-sm);
    font-weight: 700
}

.step:not(:last-child)::after {
    content: "";
    width: 44px;
    height: 1px;
    margin-left: var(--space-2);
    background: var(--border)
}

.step-index {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%
}

.step.active {
    color: var(--primary)
}

.step.active .step-index {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white)
}

.step.done {
    color: var(--success)
}

.step.done .step-index {
    border-color: var(--success);
    background: var(--success);
    color: var(--white)
}

.tabs {
    display: flex;
    gap: var(--space-2);
    border-bottom: 1px solid var(--border)
}

.tab {
    padding: .7rem .2rem;
    margin-right: var(--space-4);
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer
}

.tab.active {
    border-color: var(--accent);
    color: var(--text)
}

@media(max-width:640px) {
    .field-row {
        grid-template-columns: 1fr
    }

    .step-label {
        display: none
    }

    .step:not(:last-child)::after {
        width: 20px
    }

    .modal-foot {
        flex-direction: column-reverse
    }

    .modal-foot .btn {
        width: 100%
    }
}