/*
 * Kundenbereich (packages/Core).
 * Design nach dem Laravel Vue Starter Kit, als handgeschriebenes CSS ohne Build.
 */

:root {
    --background: oklch(1 0 0);
    --foreground: oklch(0.145 0 0);
    --card: oklch(1 0 0);
    --popover: oklch(1 0 0);
    --popover-foreground: oklch(0.145 0 0);
    --primary: oklch(0.205 0 0);
    --primary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.97 0 0);
    --muted-foreground: oklch(0.556 0 0);
    --accent: oklch(0.97 0 0);
    --accent-foreground: oklch(0.205 0 0);
    --destructive: oklch(0.577 0.245 27.325);
    --destructive-foreground: oklch(0.577 0.245 27.325);
    --success: oklch(0.627 0.194 149.214);
    --border: oklch(0.922 0 0);
    --input: oklch(0.922 0 0);
    --ring: oklch(0.87 0 0);
    --link-decoration: oklch(0.87 0 0);
    --radius: 0.625rem;
    --sidebar: oklch(0.985 0 0);
    --sidebar-foreground: oklch(0.145 0 0);
    --sidebar-primary: oklch(0.205 0 0);
    --sidebar-accent: oklch(0.97 0 0);
    --sidebar-accent-foreground: oklch(0.205 0 0);
    --sidebar-border: oklch(0.922 0 0);
    --sidebar-ring: oklch(0.87 0 0);
    --input-background: transparent;

    --radius-lg: var(--radius);
    --radius-md: calc(var(--radius) - 2px);
    --radius-sm: calc(var(--radius) - 4px);
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --focus-ring: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
    --font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';

    --sidebar-width: 16rem;
    --sidebar-width-mobile: 18rem;
    --sidebar-width-icon: 3rem;

    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: oklch(0.145 0 0);
        --foreground: oklch(0.985 0 0);
        --card: oklch(0.145 0 0);
        --popover: oklch(0.145 0 0);
        --popover-foreground: oklch(0.985 0 0);
        --primary: oklch(0.985 0 0);
        --primary-foreground: oklch(0.205 0 0);
        --muted: oklch(0.269 0 0);
        --muted-foreground: oklch(0.708 0 0);
        --accent: oklch(0.269 0 0);
        --accent-foreground: oklch(0.985 0 0);
        --destructive: oklch(0.396 0.141 25.723);
        --destructive-foreground: oklch(0.637 0.237 25.331);
        --success: oklch(0.723 0.219 149.579);
        --border: oklch(0.269 0 0);
        --input: oklch(0.269 0 0);
        --ring: oklch(0.439 0 0);
        --link-decoration: oklch(0.556 0 0);
        --sidebar: oklch(0.205 0 0);
        --sidebar-foreground: oklch(0.985 0 0);
        --sidebar-primary: oklch(0.985 0 0);
        --sidebar-accent: oklch(0.269 0 0);
        --sidebar-accent-foreground: oklch(0.985 0 0);
        --sidebar-border: oklch(0.269 0 0);
        --sidebar-ring: oklch(0.439 0 0);
        --input-background: color-mix(in oklab, var(--input) 30%, transparent);
    }
}

/* Basis */

*,
*::before,
*::after {
    box-sizing: border-box;
    border: 0 solid var(--border);
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
    color: inherit;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    pointer-events: none;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Button */

.btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.25rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background: transparent;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    white-space: nowrap;
    cursor: pointer;
    outline: none;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn:focus-visible {
    border-color: var(--ring);
    box-shadow: var(--focus-ring);
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

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

.btn--primary:hover {
    background: color-mix(in oklab, var(--primary) 90%, transparent);
}

.btn--outline {
    border-color: var(--border);
    background: var(--background);
    box-shadow: var(--shadow-xs);
}

.btn--outline:hover,
.btn--ghost:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

.btn--sm {
    height: 2rem;
    gap: 0.375rem;
    padding: 0 0.75rem;
}

.btn--icon {
    width: 2.25rem;
    padding: 0;
}

.btn--block {
    width: 100%;
}

.btn__spinner {
    display: none;
    animation: core-spin 1s linear infinite;
}

.btn[data-loading] .btn__spinner {
    display: block;
}

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

/* Formular */

.form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form__submit {
    margin-top: 1rem;
}

.field {
    display: grid;
    gap: 0.5rem;
}

.label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    user-select: none;
}

.label--checkbox {
    gap: 0.75rem;
    cursor: pointer;
}

.input {
    display: block;
    width: 100%;
    min-width: 0;
    height: 2.25rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    background: var(--input-background);
    box-shadow: var(--shadow-xs);
    font-size: 1rem;
    outline: none;
    transition: color 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.input::placeholder {
    color: var(--muted-foreground);
}

.input::selection {
    background: var(--primary);
    color: var(--primary-foreground);
}

.input:focus-visible {
    border-color: var(--ring);
    box-shadow: var(--focus-ring);
}

.input[aria-invalid='true'] {
    border-color: var(--destructive);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent);
}

.input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

@media (min-width: 768px) {
    .input {
        font-size: 0.875rem;
    }
}

.password-input {
    position: relative;
}

.password-input .input {
    padding-right: 2.5rem;
}

.password-input__toggle {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: none;
    color: var(--muted-foreground);
    cursor: pointer;
    outline: none;
}

.password-input__toggle:hover {
    color: var(--foreground);
}

.password-input__toggle:focus-visible {
    box-shadow: var(--focus-ring);
}

.password-input__toggle .icon--hide,
.password-input[data-visible] .password-input__toggle .icon--show {
    display: none;
}

.password-input[data-visible] .password-input__toggle .icon--hide {
    display: block;
}

.checkbox {
    position: relative;
    display: inline-grid;
    flex-shrink: 0;
    place-items: center;
}

.checkbox__input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    border: 1px solid var(--input);
    border-radius: 4px;
    background: var(--input-background);
    box-shadow: var(--shadow-xs);
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: box-shadow 0.15s;
}

.checkbox__input:checked {
    border-color: var(--primary);
    background: var(--primary);
}

.checkbox__input:focus-visible {
    border-color: var(--ring);
    box-shadow: var(--focus-ring);
}

.checkbox__check {
    position: absolute;
    display: none;
    width: 0.875rem;
    height: 0.875rem;
    color: var(--primary-foreground);
}

.checkbox__input:checked + .checkbox__check {
    display: block;
}

.input-error {
    font-size: 0.875rem;
    color: var(--destructive-foreground);
}

.status {
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--success);
}

.text-link {
    color: var(--foreground);
    text-decoration: underline;
    text-decoration-color: var(--link-decoration);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.3s ease-out;
}

.text-link:hover {
    text-decoration-color: currentColor;
}

/* Anmeldeseite */

.auth {
    display: flex;
    min-height: 100svh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--background);
}

@media (min-width: 768px) {
    .auth {
        padding: 2.5rem;
    }
}

.auth__inner {
    display: flex;
    width: 100%;
    max-width: 24rem;
    flex-direction: column;
    gap: 2rem;
}

.auth__inner--wide {
    max-width: 40rem;
}

.auth__brand {
    display: flex;
    justify-content: center;
}

.auth__brand svg,
.auth__brand img {
    width: auto;
    max-width: 100%;
    height: 9rem;
}

.auth__brand #core_brand {
    display: none;
}

.auth__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.auth__heading {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth__title {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.75rem;
}

.auth__description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* Logo / Marke */

.brand-mark {
    display: flex;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--sidebar-primary);
    color: var(--sidebar);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
}

.brand-mark--lg {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
}

.brand-name {
    flex: 1;
    min-width: 0;
    margin-left: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
}

/* App-Rahmen mit Sidebar (Variante "inset", einklappbar auf Icons) */

.app {
    display: flex;
    width: 100%;
    min-height: 100svh;
    background: var(--sidebar);
}

.sidebar {
    display: none;
    color: var(--sidebar-foreground);
}

.sidebar__gap {
    position: relative;
    width: var(--sidebar-width);
    transition: width 0.2s linear;
}

.sidebar__panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    display: flex;
    width: var(--sidebar-width);
    height: 100svh;
    padding: 0.5rem;
    transition: width 0.2s linear;
}

.sidebar__inner {
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    background: var(--sidebar);
}

@media (min-width: 768px) {
    .sidebar {
        display: block;
    }
}

.sidebar__header,
.sidebar__footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

.sidebar__content {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    overflow: auto;
}

.nav-group {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    padding: 0 0.5rem;
}

.nav-group__label {
    display: flex;
    height: 2rem;
    flex-shrink: 0;
    align-items: center;
    padding: 0 0.5rem;
    border-radius: var(--radius-md);
    color: color-mix(in oklab, var(--sidebar-foreground) 70%, transparent);
    font-size: 0.75rem;
    font-weight: 500;
    transition: margin 0.2s linear, opacity 0.2s linear;
}

.nav-menu {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-menu__item {
    position: relative;
}

.nav-button {
    display: flex;
    width: 100%;
    height: 2rem;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    background: none;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    outline: none;
    transition: width 0.2s linear, height 0.2s linear, padding 0.2s linear, background-color 0.15s;
}

.nav-button:hover,
.nav-button[aria-current='page'],
.nav-button[aria-expanded='true'] {
    background: var(--sidebar-accent);
    color: var(--sidebar-accent-foreground);
}

.nav-button[aria-current='page'] {
    font-weight: 500;
}

.nav-button:focus-visible {
    box-shadow: 0 0 0 2px var(--sidebar-ring);
}

.nav-button > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-button--lg {
    height: 3rem;
}

.nav-button__trailing {
    margin-left: auto;
}

.app[data-sidebar-state='collapsed'] .sidebar__gap {
    width: calc(var(--sidebar-width-icon) + 1rem);
}

.app[data-sidebar-state='collapsed'] .sidebar__panel {
    width: calc(var(--sidebar-width-icon) + 1rem + 2px);
}

.app[data-sidebar-state='collapsed'] .sidebar .sidebar__content {
    overflow: hidden;
}

.app[data-sidebar-state='collapsed'] .sidebar .nav-group__label {
    margin-top: -2rem;
    opacity: 0;
}

.app[data-sidebar-state='collapsed'] .sidebar .nav-button {
    width: 2rem;
    height: 2rem;
}

.app[data-sidebar-state='collapsed'] .sidebar .nav-button--lg {
    padding: 0;
}

/* Benutzerinfo und Menue */

.avatar {
    display: flex;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--muted);
    color: var(--foreground);
    font-size: 0.875rem;
}

.user-info__text {
    display: grid;
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    line-height: 1.25;
    text-align: left;
}

.user-info__name {
    font-weight: 500;
}

.user-info__email {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.user-menu {
    position: relative;
}

.menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 4px);
    left: 0;
    z-index: 50;
    min-width: 14rem;
    padding: 0.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--popover);
    color: var(--popover-foreground);
    box-shadow: var(--shadow-md);
    animation: core-fade-in 0.15s ease-out;
}

.app[data-sidebar-state='collapsed'] .sidebar .menu {
    right: auto;
    bottom: 0;
    left: calc(100% + 0.5rem);
}

.menu__label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.25rem;
}

.menu__separator {
    height: 1px;
    margin: 0.25rem -0.25rem;
    background: var(--border);
}

.menu__item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-sm);
    background: none;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    outline: none;
}

.menu__item:hover,
.menu__item:focus-visible {
    background: var(--accent);
    color: var(--accent-foreground);
}

.menu__item .icon {
    color: var(--muted-foreground);
}

@keyframes core-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Inhaltsbereich */

.app-main {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    overflow-x: clip;
    background: var(--background);
}

@media (min-width: 768px) {
    .app-main {
        margin: 0.5rem 0.5rem 0.5rem 0;
        border-radius: 0.75rem;
        box-shadow: var(--shadow-sm);
    }

    .app[data-sidebar-state='collapsed'] .app-main {
        margin-left: 0.5rem;
    }
}

.app-header {
    display: flex;
    height: 4rem;
    flex-shrink: 0;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid color-mix(in oklab, var(--sidebar-border) 70%, transparent);
    transition: height 0.2s linear;
}

@media (min-width: 768px) {
    .app-header {
        padding: 0 1rem;
    }

    .app[data-sidebar-state='collapsed'] .app-header {
        height: 3rem;
    }
}

.app-header__trigger {
    width: 1.75rem;
    height: 1.75rem;
    margin-left: -0.25rem;
}

.app-header__trigger .icon--open,
.app[data-sidebar-state='collapsed'] .app-header__trigger .icon--close {
    display: none;
}

.app[data-sidebar-state='collapsed'] .app-header__trigger .icon--open {
    display: block;
}

@media (max-width: 767px) {
    .app-header__trigger .icon--open {
        display: block;
    }

    .app-header__trigger .icon--close {
        display: none;
    }
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    overflow-wrap: break-word;
}

@media (min-width: 640px) {
    .breadcrumbs {
        gap: 0.625rem;
    }
}

.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.breadcrumbs__link {
    transition: color 0.15s;
}

.breadcrumbs__link:hover,
.breadcrumbs__current {
    color: var(--foreground);
}

.breadcrumbs__separator {
    width: 0.875rem;
    height: 0.875rem;
}

.page {
    display: flex;
    height: 100%;
    flex: 1;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

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

@media (min-width: 768px) {
    .tile-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    padding: 1rem;
    border: 1px solid color-mix(in oklab, var(--sidebar-border) 70%, transparent);
    border-radius: 0.75rem;
    transition: background-color 0.15s, border-color 0.15s;
}

a.tile:hover {
    border-color: var(--ring);
    background: var(--accent);
}

a.tile:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.tile__icon {
    display: flex;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--sidebar-accent);
}

.tile__title {
    font-weight: 500;
}

.tile--placeholder {
    min-height: 16rem;
    flex: 1;
    align-items: center;
    justify-content: center;
    aspect-ratio: auto;
}

.tile__empty {
    position: relative;
    max-width: 24rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    text-align: center;
}

.placeholder-pattern {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    stroke: color-mix(in oklab, var(--foreground) 20%, transparent);
}

/* Inhaltsbausteine fuer Packages */

.heading {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.heading__title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.75rem;
    letter-spacing: -0.025em;
}

.heading__description {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.alert {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    color: var(--success);
    font-size: 0.875rem;
    font-weight: 500;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: var(--card);
    box-shadow: var(--shadow-sm);
}

.card__header {
    display: grid;
    gap: 0.375rem;
    padding: 0 1.5rem;
}

.card__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
}

.card__description {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.card__content {
    padding: 0 1.5rem;
}

.stat__label {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.stat__value {
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 2.25rem;
    letter-spacing: -0.025em;
}

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

.inline-form__field {
    display: grid;
    flex: 1;
    min-width: 0;
    gap: 0.5rem;
}

.list {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.list__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--border);
}

.list__item:last-child {
    border-bottom: 0;
}

.list__text {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.list__item[data-done] .list__text {
    color: var(--muted-foreground);
    text-decoration: line-through;
}

.list__form {
    display: contents;
}

/*
 * Ladezustand fuer per AJAX ausgetauschte Bereiche (app.js setzt aria-busy).
 *
 * Inhalt wird abgeblendet und leicht verwischt. ::before legt einen
 * Lichtstreifen an die Oberkante und einen diagonalen Schimmer ueber den
 * Bereich, ::after ist ein leuchtender Ring in der Mitte. Alles erscheint erst
 * nach kurzer Verzoegerung, damit schnelle Antworten nicht flackern. Die
 * Navigation wird nur abgeblendet, der Content bekommt den Ring in der Mitte
 * des Sichtbereichs.
 */
:root {
    --glow: oklch(0.78 0.15 215);
    --glow-strong: oklch(0.68 0.24 295);
}

[aria-busy='true'] {
    position: relative;
    pointer-events: none;
}

[aria-busy='true'] > * {
    opacity: 0.45;
    filter: blur(1px) saturate(0.6);
    transition: opacity 0.2s ease 0.1s, filter 0.2s ease 0.1s;
}

[aria-busy='true']:not([data-core-nav])::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 19;
    overflow: hidden;
    border-radius: inherit;
    background:
        linear-gradient(90deg, transparent, var(--glow), var(--glow-strong), transparent) no-repeat,
        linear-gradient(105deg, transparent 35%, color-mix(in oklab, var(--glow) 14%, transparent) 50%, transparent 65%) no-repeat;
    background-size: 35% 2px, 250% 100%;
    animation: core-scan 1.4s cubic-bezier(0.6, 0, 0.4, 1) infinite, core-busy-in 0.25s ease-out 0.15s both;
}

[aria-busy='true']:not([data-core-nav])::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 20;
    width: 2.75rem;
    height: 2.75rem;
    margin: -1.375rem 0 0 -1.375rem;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 15%, var(--glow) 55%, var(--glow-strong) 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    filter: drop-shadow(0 0 6px var(--glow)) drop-shadow(0 0 14px color-mix(in oklab, var(--glow-strong) 60%, transparent));
    animation: core-spin 0.9s linear infinite, core-busy-in 0.25s ease-out 0.15s both, core-pulse 1.8s ease-in-out infinite;
}

[data-core-content][aria-busy='true']::after {
    position: fixed;
}

@keyframes core-scan {
    from {
        background-position: -40% 0, 120% 0;
    }

    to {
        background-position: 140% 0, -20% 0;
    }
}

@keyframes core-pulse {
    50% {
        width: 3.25rem;
        height: 3.25rem;
        margin: -1.625rem 0 0 -1.625rem;
    }
}

@media (min-width: 768px) {
    [data-core-content][aria-busy='true']::after {
        left: calc(50% + var(--sidebar-width) / 2);
    }

    .app[data-sidebar-state='collapsed'] [data-core-content][aria-busy='true']::after {
        left: calc(50% + (var(--sidebar-width-icon) + 1rem) / 2);
    }
}

@keyframes core-busy-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.empty-text {
    margin-top: 1rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* Mobile Sidebar als Sheet */

.sheet {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
}

.app[data-mobile-open] .sheet {
    display: block;
}

.sheet__overlay {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / 0.5);
    animation: core-overlay-in 0.2s ease-out;
}

.sheet__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: var(--sidebar-width-mobile);
    max-width: 75%;
    flex-direction: column;
    background: var(--sidebar);
    color: var(--sidebar-foreground);
    box-shadow: var(--shadow-md);
    animation: core-slide-in 0.25s ease-out;
}

@media (min-width: 768px) {
    .app[data-mobile-open] .sheet {
        display: none;
    }
}

@keyframes core-overlay-in {
    from {
        opacity: 0;
    }
}

@keyframes core-slide-in {
    from {
        transform: translateX(-100%);
    }
}

/* Anmeldung: Passwort vergessen, 2FA, Passkeys */
.btn--destructive {
    background: var(--destructive);
    color: #fff;
}

.btn--destructive:hover {
    background: color-mix(in oklab, var(--destructive) 90%, transparent);
}

.field__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.field__hint {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.text-sm {
    font-size: 0.875rem;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.auth__footer {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    text-align: center;
}

.status--success {
    color: var(--success);
}

.passkey-block {
    display: grid;
    gap: 1rem;
}

.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    text-transform: uppercase;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.disclosure {
    font-size: 0.875rem;
}

.disclosure__summary {
    color: var(--muted-foreground);
    cursor: pointer;
}

.disclosure__summary:hover {
    color: var(--foreground);
}

.disclosure__content {
    margin-top: 1rem;
}

.input--code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.3em;
}

/* Einstellungen */
.settings {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.settings__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.settings__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.settings__link:hover {
    background: var(--accent);
    color: var(--accent-foreground);
}

.settings__link[aria-current='page'] {
    background: var(--muted);
    color: var(--foreground);
}

.settings__content {
    display: flex;
    flex: 1;
    min-width: 0;
    max-width: 42rem;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .settings {
        flex-direction: row;
    }

    .settings__nav {
        width: 12rem;
        flex-direction: column;
        flex-shrink: 0;
    }
}

.heading--sm .heading__title {
    font-size: 1rem;
}

.form--settings {
    gap: 1.25rem;
}

.notice {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.badge {
    display: inline-flex;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: var(--muted);
    font-size: 0.75rem;
    font-weight: 500;
    vertical-align: middle;
}

.badge--success {
    background: color-mix(in oklab, var(--success) 15%, transparent);
    color: var(--success);
}

.two-factor-setup {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.5rem;
}

.two-factor-setup > .stack {
    flex: 1;
    min-width: 14rem;
}

.qr-code {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
    line-height: 0;
}

.qr-code svg {
    width: 10rem;
    height: 10rem;
}

.secret {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.code-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.25rem 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    background: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.875rem;
    list-style: none;
}

.button-row {
    display: flex;
    gap: 0.5rem;
}

.list__item > .icon {
    color: var(--muted-foreground);
}

.list__meta {
    display: block;
    color: var(--muted-foreground);
    font-size: 0.75rem;
}

a.menu__item {
    color: inherit;
    text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
