:root {
    color-scheme: dark;

    --background: #101214;
    --surface: #191c1f;
    --surface-raised: #22262a;
    --surface-soft: #15181b;

    --border: #343a40;
    --border-strong: #4a5158;

    --text: #f2f0eb;
    --text-muted: #a9adb1;

    --accent: #d7a452;
    --accent-hover: #efbc68;
    --accent-text: #17120a;

    --danger: #df6b6b;
    --danger-hover: #ef8383;
    --danger-background: rgba(223, 107, 107, 0.1);

    --success: #77c895;
    --success-background: rgba(119, 200, 149, 0.1);

    --max-width: 1120px;
}

* {
    box-sizing: border-box;
}

html {
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--background);
    color: var(--text);
}

body {
    min-height: 100vh;
    margin: 0;

    background:
        radial-gradient(
            circle at top left,
            rgba(215, 164, 82, 0.09),
            transparent 34rem
        ),
        var(--background);
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.container {
    width: min(
        calc(100% - 2rem),
        var(--max-width)
    );

    margin-inline: auto;
}

.site-header {
    position: sticky;
    z-index: 10;
    top: 0;

    border-bottom: 1px solid var(--border);

    background: rgba(16, 18, 20, 0.9);
    backdrop-filter: blur(12px);
}

.header-content {
    min-height: 4.5rem;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    color: var(--text);

    font-size: 1.15rem;
    font-weight: 750;
    text-decoration: none;
    letter-spacing: 0.01em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-nav > a:not(.button-primary) {
    color: var(--text-muted);
    text-decoration: none;
}

.site-nav > a:not(.button-primary):hover {
    color: var(--text);
}

.main-content {
    padding-block: 3rem 5rem;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;

    margin-bottom: 2rem;
}

.page-header-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 1rem;
}

.form-page-header {
    margin-bottom: 2rem;
}

.eyebrow {
    margin: 0 0 0.5rem;

    color: var(--accent);

    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.section-number {
    margin: 0 0 0.35rem;

    color: var(--accent);

    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

h1 {
    margin: 0;

    font-size: clamp(2.4rem, 7vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

h2 {
    margin-top: 0;

    font-size: 1.25rem;
}

h3 {
    margin: 0;

    font-size: 1rem;
}

.page-description {
    max-width: 44rem;
    margin: 1.25rem 0 0;

    color: var(--text-muted);

    line-height: 1.65;
}

.result-count {
    color: var(--text-muted);

    font-size: 0.9rem;
}

.button-primary,
.button-secondary,
.button-danger,
.button-danger-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 2.8rem;

    border-radius: 0.65rem;
    padding: 0.75rem 1.1rem;

    font-weight: 720;
    text-decoration: none;

    transition:
        background 140ms ease,
        border-color 140ms ease,
        color 140ms ease,
        transform 140ms ease;
}

.button-primary {
    border: 1px solid var(--accent);

    background: var(--accent);
    color: var(--accent-text);
}

.button-primary:hover {
    border-color: var(--accent-hover);

    background: var(--accent-hover);

    transform: translateY(-1px);
}

.button-secondary {
    border: 1px solid var(--border);

    background: transparent;
    color: var(--text);
}

.button-secondary:hover {
    border-color: var(--border-strong);

    background: var(--surface-raised);
}

.button-danger {
    border: 1px solid var(--danger);

    background: var(--danger);
    color: #1a0c0c;
}

.button-danger:hover {
    border-color: var(--danger-hover);

    background: var(--danger-hover);
}

.button-danger-secondary {
    border: 1px solid rgba(223, 107, 107, 0.55);

    background: transparent;
    color: var(--danger);
}

.button-danger-secondary:hover {
    border-color: var(--danger);

    background: var(--danger-background);
}

.button-small {
    min-height: 2.3rem;
    padding: 0.5rem 0.8rem;

    font-size: 0.85rem;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.action-row-centered {
    justify-content: center;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) auto auto;
    gap: 0.75rem;

    margin-bottom: 1.5rem;
}

.search-form input {
    min-width: 0;

    border: 1px solid var(--border);
    border-radius: 0.65rem;
    padding: 0.85rem 1rem;

    background: var(--surface);
    color: var(--text);
    outline: none;
}

.search-form input:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(215, 164, 82, 0.14);
}

.search-summary {
    margin: 0 0 1.5rem;

    color: var(--text-muted);
}

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

.cocktail-card {
    min-height: 10rem;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;

    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 1.25rem;

    background: var(--surface);

    text-decoration: none;

    transition:
        transform 140ms ease,
        border-color 140ms ease,
        background 140ms ease;
}

.cocktail-card:hover {
    transform: translateY(-3px);

    border-color: var(--accent);

    background: var(--surface-raised);
}

.cocktail-card-name {
    font-size: 1.3rem;
    font-weight: 720;
    line-height: 1.2;
}

.cocktail-card-link {
    color: var(--accent);

    font-size: 0.85rem;
    font-weight: 700;
}

.empty-state {
    border: 1px dashed var(--border);
    border-radius: 0.9rem;
    padding: 3rem 1.5rem;

    background: var(--surface);

    text-align: center;
}

.empty-state p {
    margin-bottom: 1.5rem;

    color: var(--text-muted);
}

.empty-state h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
}

.back-link {
    display: inline-block;

    color: var(--text-muted);

    text-decoration: none;
}

.back-link:hover {
    color: var(--accent);
}

.detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 2rem;
}

.recipe {
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;

    background: var(--surface);
}

.recipe-header {
    padding: clamp(1.5rem, 5vw, 3.5rem);

    border-bottom: 1px solid var(--border);

    background:
        linear-gradient(
            135deg,
            rgba(215, 164, 82, 0.13),
            transparent 65%
        );
}

.recipe-header h1 {
    font-size: clamp(2.2rem, 6vw, 4rem);
}

.recipe-layout {
    display: grid;
    grid-template-columns:
        minmax(16rem, 0.8fr) 1.2fr;
}

.recipe-section {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.recipe-section + .recipe-section {
    border-left: 1px solid var(--border);
}

.ingredient-list {
    display: grid;
    gap: 0.8rem;

    margin: 0;
    padding: 0;

    list-style: none;
}

.ingredient-list > li {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.8rem;

    line-height: 1.5;
}

.ingredient-list > li:last-child {
    border-bottom: 0;
}

.preparation {
    margin: 0;

    color: var(--text-muted);

    font-size: 1.05rem;
    line-height: 1.75;
    white-space: pre-wrap;
}

.flash-stack {
    display: grid;
    gap: 0.75rem;

    margin-bottom: 2rem;
}

.flash {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem 1.1rem;

    background: var(--surface);
}

.flash-success {
    border-color: rgba(119, 200, 149, 0.55);

    background: var(--success-background);
    color: var(--success);
}

.flash-error {
    border-color: rgba(223, 107, 107, 0.55);

    background: var(--danger-background);
    color: var(--danger);
}

.error-summary {
    margin-bottom: 1.5rem;

    border: 1px solid rgba(223, 107, 107, 0.55);
    border-radius: 0.85rem;
    padding: 1.25rem;

    background: var(--danger-background);
}

.error-summary h2 {
    margin-bottom: 0.75rem;

    color: var(--danger);
}

.error-summary ul {
    display: grid;
    gap: 0.4rem;

    margin: 0;
    padding-left: 1.25rem;
}

.cocktail-form {
    display: grid;
    gap: 1.25rem;
}

.form-card {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1.25rem, 4vw, 2rem);

    background: var(--surface);
}

.form-section-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 1.5rem;
}

.form-section-heading h2 {
    margin: 0;
}

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

.ingredient-grid {
    grid-template-columns:
        minmax(12rem, 2fr)
        repeat(3, minmax(7rem, 1fr));
}

.field {
    display: grid;
    align-content: start;
    gap: 0.45rem;

    min-width: 0;
}

.field > span {
    color: var(--text-muted);

    font-size: 0.82rem;
    font-weight: 700;
}

.field-wide {
    grid-column: 1 / -1;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-width: 0;

    border: 1px solid var(--border);
    border-radius: 0.65rem;
    padding: 0.8rem 0.9rem;

    background: var(--surface-soft);
    color: var(--text);
    outline: none;
}

.field textarea {
    resize: vertical;

    line-height: 1.6;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(215, 164, 82, 0.14);
}

.ingredient-editor-list {
    display: grid;
    gap: 1rem;
}

.ingredient-editor-row {
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem;

    background: var(--surface-soft);
}

.ingredient-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    margin-bottom: 1rem;
}

.remove-row-button {
    border: 0;
    padding: 0.25rem;

    background: transparent;
    color: var(--danger);

    font-size: 0.8rem;
}

.remove-row-button:hover {
    color: var(--danger-hover);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;

    margin-top: 0.25rem;
}

.delete-card {
    max-width: 46rem;

    border: 1px solid rgba(223, 107, 107, 0.45);
    border-radius: 1rem;
    padding: clamp(1.5rem, 5vw, 3rem);

    background:
        linear-gradient(
            135deg,
            rgba(223, 107, 107, 0.09),
            transparent 70%
        ),
        var(--surface);
}

.delete-card h1 {
    font-size: clamp(2.2rem, 6vw, 4rem);
}

.delete-warning {
    margin: 2rem 0 0;

    font-size: 1.1rem;
    line-height: 1.6;
}

.delete-note {
    margin: 1rem 0 2rem;

    color: var(--text-muted);

    line-height: 1.6;
}

.visually-hidden {
    position: absolute;

    width: 1px;
    height: 1px;
    overflow: hidden;

    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 980px) {
    .ingredient-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .ingredient-name-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .main-content {
        padding-top: 2rem;
    }

    .header-content {
        align-items: flex-start;
        flex-direction: column;

        padding-block: 1rem;
    }

    .site-nav {
        width: 100%;

        justify-content: space-between;
    }

    .page-header {
        align-items: start;
        flex-direction: column;
        gap: 1rem;
    }

    .page-header-actions {
        width: 100%;

        justify-content: space-between;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .detail-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .recipe-layout {
        grid-template-columns: 1fr;
    }

    .recipe-section + .recipe-section {
        border-top: 1px solid var(--border);
        border-left: 0;
    }

    .form-grid,
    .ingredient-grid {
        grid-template-columns: 1fr;
    }

    .ingredient-name-field,
    .field-wide {
        grid-column: auto;
    }

    .form-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-actions > * {
        width: 100%;
    }
}

/* Zutatenverwaltung */

.data-table-wrapper {
    overflow-x: auto;

    border: 1px solid var(--border);
    border-radius: 0.9rem;

    background: var(--surface);
}

.data-table {
    width: 100%;
    min-width: 58rem;

    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;

    border-bottom: 1px solid var(--border);

    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--text-muted);

    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: var(--surface-raised);
}

.table-note {
    display: block;

    max-width: 22rem;
    margin-top: 0.35rem;

    color: var(--text-muted);

    font-size: 0.82rem;
    line-height: 1.45;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;

    white-space: nowrap;
}

.table-actions a {
    color: var(--accent);

    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.table-actions a:hover {
    color: var(--accent-hover);
}

.table-actions .danger-link {
    color: var(--danger);
}

.table-actions .danger-link:hover {
    color: var(--danger-hover);
}

.status-badge {
    display: inline-flex;

    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem 0.55rem;

    background: var(--surface-soft);
    color: var(--text-muted);

    font-size: 0.78rem;
    white-space: nowrap;
}

.form-help {
    max-width: 48rem;
    margin: -0.35rem 0 1.5rem;

    color: var(--text-muted);

    font-size: 0.92rem;
    line-height: 1.6;
}

.form-grid-three {
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
}

@media (max-width: 820px) {
    .form-grid-three {
        grid-template-columns: 1fr;
    }
}

/* Zutaten-Autocomplete und mobiler Erstellungsdialog */

.ingredient-autocomplete {
    position: relative;
}

.ingredient-autocomplete > label {
    display: contents;
}

.autocomplete-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% - 1.1rem);
    right: 0;
    left: 0;

    max-height: 20rem;
    overflow-y: auto;

    border: 1px solid var(--border-strong);
    border-radius: 0.75rem;
    padding: 0.35rem;

    background: var(--surface-raised);
    box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.38);
}

.autocomplete-option {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    border: 0;
    border-radius: 0.55rem;
    padding: 0.8rem 0.85rem;

    background: transparent;
    color: var(--text);

    text-align: left;
}

.autocomplete-option:hover,
.autocomplete-option:focus-visible {
    background: rgba(215, 164, 82, 0.13);
    outline: none;
}

.autocomplete-option-name {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-option-meta {
    flex: 0 0 auto;

    color: var(--text-muted);

    font-size: 0.78rem;
}

.autocomplete-create-option {
    border-top: 1px solid var(--border);
    border-radius: 0 0 0.55rem 0.55rem;

    color: var(--accent);
}

.autocomplete-create-symbol {
    flex: 0 0 auto;

    font-size: 1.35rem;
    line-height: 1;
}

.field-message {
    min-height: 1.15rem;
    margin: 0;

    color: var(--text-muted);

    font-size: 0.76rem;
}

.field-message.is-selected {
    color: var(--success);
}

.ingredient-editor-row.has-selection-error {
    border-color: var(--danger);
}

.ingredient-editor-row.has-selection-error .field-message {
    color: var(--danger);
}

.ingredient-dialog,
.premix-dialog,
.catalog-dialog {
    width: min(42rem, calc(100% - 2rem));
    max-height: min(48rem, calc(100dvh - 2rem));

    border: 1px solid var(--border-strong);
    border-radius: 1rem;
    padding: 0;

    background: var(--surface);
    color: var(--text);

    box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.55);
}

.ingredient-dialog::backdrop,
.premix-dialog::backdrop,
.catalog-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

.dialog-form {
    max-height: inherit;

    display: flex;
    flex-direction: column;
}

.dialog-header,
.dialog-actions {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;

    padding: 1.25rem;

    background: var(--surface);
}

.dialog-header {
    border-bottom: 1px solid var(--border);
}

.dialog-header h2 {
    margin: 0;
}

.dialog-close {
    width: 2.75rem;
    height: 2.75rem;

    border: 1px solid var(--border);
    border-radius: 999px;

    background: var(--surface-soft);
    color: var(--text-muted);

    font-size: 1.5rem;
    line-height: 1;
}

.dialog-close:hover {
    color: var(--text);
}

.dialog-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;

    display: grid;
    gap: 1rem;

    padding: 1.25rem;
}

.dialog-actions {
    border-top: 1px solid var(--border);

    justify-content: flex-end;
}

.dialog-help {
    margin: 0;
}

.dialog-errors {
    border: 1px solid rgba(223, 107, 107, 0.55);
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;

    background: var(--danger-background);
    color: var(--danger);
}

.dialog-errors ul {
    margin: 0;
    padding-left: 1.2rem;
}

@media (max-width: 600px) {
    .ingredient-dialog,
.premix-dialog,
.catalog-dialog {
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;

        border: 0;
        border-radius: 0;
    }

    .dialog-header,
    .dialog-body,
    .dialog-actions {
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-left: max(1rem, env(safe-area-inset-left));
    }

    .dialog-header {
        padding-top: max(1rem, env(safe-area-inset-top));
    }

    .dialog-actions {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .dialog-actions > * {
        min-height: 3rem;
    }

    .autocomplete-menu {
        position: fixed;
        z-index: 40;
        top: auto;
        right: 0.75rem;
        bottom: max(0.75rem, env(safe-area-inset-bottom));
        left: 0.75rem;

        max-height: min(18rem, 42dvh);
    }
}


.card-meta {
    color: var(--text-muted);
    font-size: 0.86rem;
}

.form-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.recipe-meta-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    border-bottom: 1px solid var(--border);
    background: var(--border);
}

.recipe-meta-grid > div {
    display: grid;
    gap: 0.35rem;
    padding: 1.1rem 1.25rem;
    background: var(--surface-soft);
}

.recipe-meta-grid span {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.recipe-step-list {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.recipe-step-list li::marker {
    color: var(--accent);
    font-weight: 800;
}

.step-editor-list {
    display: grid;
    gap: 1rem;
}

.step-editor-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem;
    background: var(--surface-soft);
}

.step-number {
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(215, 164, 82, 0.15);
    color: var(--accent);
    font-weight: 800;
}

.inventory-entry-list {
    display: grid;
    gap: 1rem;
}

.inventory-entry-row {
    display: grid;
    grid-template-columns: minmax(14rem, 2fr) 1fr 0.65fr auto;
    align-items: end;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem;
    background: var(--surface-soft);
}

.result-card {
    margin-top: 1.5rem;
}

@media (max-width: 980px) {
    .form-grid-four,
    .recipe-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inventory-entry-row {
        grid-template-columns: minmax(12rem, 2fr) 1fr 0.7fr;
    }

    .inventory-entry-row .remove-row-button {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

@media (max-width: 720px) {
    .form-grid-four,
    .recipe-meta-grid,
    .inventory-entry-row {
        grid-template-columns: 1fr;
    }

    .step-editor-row {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .step-editor-row .remove-row-button {
        grid-column: 2;
        justify-self: end;
    }

    .site-nav {
        flex-wrap: wrap;
    }
}


/* Verschachtelte Rezeptkomponenten und Premix-Dialog */

.form-section-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.ingredient-entry {
    display: grid;
    gap: 0.45rem;
}

.ingredient-entry-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.ingredient-entry-title {
    min-width: 0;
    font-size: 1.05rem;
}

.ingredient-note {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.status-badge-link {
    text-decoration: none;
}

.status-badge-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.component-breakdown {
    display: grid;
    gap: 0.45rem;
    margin: 0.15rem 0 0 1rem;
    padding: 0 0 0 0.9rem;
    border-left: 1px solid var(--border-strong);
    list-style: none;
}

.component-breakdown li {
    display: grid;
    gap: 0.35rem;
    border: 0;
    padding: 0;
}

.component-breakdown-line {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.component-breakdown-marker {
    flex: 0 0 auto;
    color: var(--accent);
}

.premix-dialog {
    width: min(64rem, calc(100% - 2rem));
    max-height: min(58rem, calc(100dvh - 2rem));
}

.premix-dialog-body {
    gap: 1.25rem;
}

.dialog-section {
    display: grid;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem;
    background: var(--surface-soft);
}

.dialog-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.dialog-section-heading h3,
.dialog-section-heading p {
    margin: 0;
}

.dialog-section-heading p {
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
}

.compact-component-list,
.compact-step-list {
    display: grid;
    gap: 0.75rem;
}

.compact-component-row {
    display: grid;
    grid-template-columns:
        auto
        minmax(14rem, 2fr)
        minmax(7rem, 0.7fr)
        minmax(7rem, 0.7fr)
        auto;
    align-items: start;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.85rem;
    background: var(--surface);
}

.compact-row-number {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    margin-top: 1.55rem;
    border-radius: 999px;
    background: rgba(215, 164, 82, 0.14);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 800;
}

.compact-remove-button {
    margin-top: 1.75rem;
}

.compact-step-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.85rem;
    background: var(--surface);
}

.compact-help {
    margin: 0;
}

@media (max-width: 860px) {
    .compact-component-row {
        grid-template-columns: auto 1fr 1fr;
    }

    .compact-component-row .ingredient-autocomplete {
        grid-column: 2 / -1;
    }

    .compact-remove-button {
        grid-column: 2 / -1;
        justify-self: end;
        margin-top: 0;
    }
}

@media (max-width: 600px) {
    .form-section-actions {
        width: 100%;
    }

    .form-section-actions > * {
        flex: 1 1 auto;
    }

    .ingredient-entry-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .component-breakdown {
        margin-left: 0.35rem;
    }

    .compact-component-row,
    .compact-step-row {
        grid-template-columns: 1fr;
    }

    .compact-component-row .ingredient-autocomplete,
    .compact-remove-button {
        grid-column: auto;
    }

    .compact-row-number {
        display: none;
    }

    .compact-remove-button {
        justify-self: start;
        margin-top: 0;
    }

    .dialog-section-heading {
        align-items: stretch;
        flex-direction: column;
    }
}


/* Kategorie, Methode, Glasware, Eis und Garnitur verwalten */
.catalog-dialog {
    width: min(34rem, calc(100% - 2rem));
}

[data-catalog-select] optgroup {
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .catalog-dialog {
        width: 100%;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }
}


/* Löschen im Stammdaten-Dialog */

.catalog-dialog-actions {
    justify-content: space-between;
}

.catalog-dialog-action-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.catalog-delete-button {
    margin-right: auto;
}

@media (max-width: 600px) {
    .catalog-dialog-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .catalog-dialog-action-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .catalog-delete-button {
        width: 100%;
        margin-right: 0;
    }
}


/* Administration */

.admin-page-header {
    margin-bottom: 1.75rem;
}

.admin-quick-links {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-quick-card {
    min-height: 10rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 1.15rem;
    background: var(--surface);
    text-decoration: none;
    transition:
        transform 140ms ease,
        border-color 140ms ease,
        background 140ms ease;
}

.admin-quick-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    background: var(--surface-raised);
}

.admin-quick-card strong {
    font-size: 1.15rem;
    line-height: 1.25;
}

.admin-quick-card > span:last-child {
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
}

.admin-quick-kicker {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-section-navigation {
    position: sticky;
    z-index: 5;
    top: 5.25rem;
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.65rem;
    background: rgba(25, 28, 31, 0.94);
    backdrop-filter: blur(12px);
}

.admin-section-navigation a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 0.6rem;
    padding: 0.65rem 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
}

.admin-section-navigation a:hover {
    background: var(--surface-raised);
    color: var(--text);
}

.admin-section-navigation span {
    min-width: 1.6rem;
    border-radius: 999px;
    padding: 0.15rem 0.4rem;
    background: var(--surface-soft);
    color: var(--accent);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 800;
}

.admin-catalog-stack {
    display: grid;
    gap: 1.25rem;
}

.admin-catalog-section {
    scroll-margin-top: 10rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    background: var(--surface);
}

.admin-catalog-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-catalog-header h2 {
    margin-bottom: 0.45rem;
    font-size: 1.55rem;
}

.admin-catalog-header p {
    max-width: 46rem;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.admin-entry-count {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.admin-create-form {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.25rem;
}

.admin-entry-list {
    display: grid;
    gap: 0.7rem;
}

.admin-entry-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-soft);
}

.admin-entry-edit-form {
    display: grid;
    grid-template-columns:
        minmax(10rem, 1fr)
        minmax(5rem, auto)
        auto;
    align-items: center;
    gap: 0.7rem;
}

.admin-entry-name input {
    background: var(--surface);
}

.admin-usage {
    min-width: 5.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
}

.admin-usage strong {
    display: block;
    color: var(--text);
    font-size: 1rem;
}

.button-danger-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.38;
}

.admin-empty-state {
    border: 1px dashed var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    color: var(--text-muted);
    text-align: center;
}

.admin-future-card {
    margin-top: 1.25rem;
    border: 1px dashed var(--border);
    border-radius: 1rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    background: rgba(25, 28, 31, 0.55);
}

.admin-future-card h2 {
    margin-bottom: 0.75rem;
}

.admin-future-card p:last-child {
    max-width: 52rem;
    margin-bottom: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

@media (max-width: 980px) {
    .admin-quick-links {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .site-nav {
        flex-wrap: wrap;
    }

    .admin-section-navigation {
        top: 8.8rem;
    }

    .admin-catalog-header {
        flex-direction: column;
        gap: 0.8rem;
    }

    .admin-create-form {
        grid-template-columns: 1fr;
    }

    .admin-entry-row {
        grid-template-columns: 1fr;
    }

    .admin-entry-row > form:last-child {
        width: 100%;
    }

    .admin-entry-row > form:last-child button {
        width: 100%;
    }

    .admin-entry-edit-form {
        grid-template-columns: 1fr;
    }

    .admin-usage {
        text-align: left;
    }

    .admin-usage strong {
        display: inline;
        margin-right: 0.25rem;
    }
}

@media (max-width: 520px) {
    .admin-quick-links {
        grid-template-columns: 1fr;
    }

    .admin-quick-card {
        min-height: 8rem;
    }

    .admin-section-navigation {
        position: static;
    }
}


/* Wareneinsatz und Rezeptkalkulation */

.costing-card {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1.1rem, 3vw, 1.6rem);
    background:
        linear-gradient(
            135deg,
            rgba(201, 159, 82, 0.08),
            rgba(25, 28, 31, 0.15)
        ),
        var(--surface);
}

.costing-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.costing-header h2 {
    margin: 0;
    font-size: 1.35rem;
}

.costing-summary-grid {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0.75rem;
}

.costing-total {
    min-width: 9.5rem;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface-soft);
    text-align: right;
}

.costing-total span {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.costing-total strong {
    color: var(--accent);
    font-size: 1.35rem;
}

.costing-component-list {
    display: grid;
    gap: 0.55rem;
}

.costing-component-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0;
}

.costing-component-row:last-child {
    border-bottom: 0;
}

.costing-component-row > div {
    display: grid;
    gap: 0.15rem;
}

.costing-component-row > div span {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.costing-component-price {
    flex: 0 0 auto;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.costing-incomplete {
    color: var(--warning, #d8aa57);
}

.costing-warning {
    margin-top: 1rem;
    border: 1px solid rgba(216, 170, 87, 0.45);
    border-radius: 0.75rem;
    padding: 0.9rem;
    background: rgba(216, 170, 87, 0.08);
}

.costing-warning > strong {
    display: block;
    margin-bottom: 0.5rem;
}

.costing-warning ul {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding-left: 1.2rem;
}

.costing-warning li {
    padding-left: 0.15rem;
}

.costing-warning li a {
    display: inline-block;
    margin-left: 0.4rem;
    color: var(--accent);
    font-weight: 700;
}

.costing-note {
    margin: 1rem 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .costing-header {
        flex-direction: column;
    }

    .costing-summary-grid {
        width: 100%;
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .costing-total {
        width: 100%;
        min-width: 0;
        text-align: left;
    }
}

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

    .costing-component-row {
        align-items: flex-start;
    }
}


/* Rollen und eingeklappte Advanced Features */

.advanced-features {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    background: var(--surface);
}

.advanced-features-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
    padding: 1rem 1.15rem;
    user-select: none;
}

.advanced-features-summary::-webkit-details-marker {
    display: none;
}

.advanced-features-summary:hover {
    background: var(--surface-raised);
}

.advanced-features-summary > span:first-child {
    display: grid;
    gap: 0.15rem;
}

.advanced-features-summary strong {
    font-size: 0.95rem;
}

.advanced-features-summary small {
    color: var(--text-muted);
    font-size: 0.76rem;
}

.advanced-features-toggle {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
}

.advanced-features[open]
.advanced-features-toggle {
    font-size: 0;
}

.advanced-features[open]
.advanced-features-toggle::after {
    content: "Verbergen";
    font-size: 0.72rem;
}

.advanced-features-content {
    border-top: 1px solid var(--border);
    padding: 1rem;
}

.advanced-features-content .costing-card {
    margin-bottom: 0;
    border: 0;
    padding: 0;
    background: transparent;
}

.access-denied {
    max-width: 42rem;
    margin-inline: auto;
}


/* Anmeldung und Benutzerverwaltung */

.account-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: 0.4rem;
    border-left: 1px solid var(--border);
    padding-left: 0.9rem;
}

.account-identity {
    display: grid;
    gap: 0.05rem;
    text-align: right;
}

.account-identity strong {
    font-size: 0.82rem;
}

.account-identity span {
    color: var(--text-muted);
    font-size: 0.68rem;
}

.auth-layout {
    min-height: min(68vh, 42rem);
    display: grid;
    grid-template-columns:
        minmax(0, 1.1fr)
        minmax(19rem, 0.9fr);
    align-items: center;
    gap: clamp(2rem, 7vw, 6rem);
    padding-block: 3rem;
}

.auth-intro h1 {
    max-width: 12ch;
    margin-bottom: 1rem;
    font-size: clamp(2.2rem, 7vw, 4.5rem);
    line-height: 0.98;
}

.auth-intro > p:not(.eyebrow) {
    max-width: 38rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.auth-security-note {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
}

.auth-card {
    display: grid;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1.25rem, 4vw, 2rem);
    background: var(--surface);
    box-shadow: 0 1.25rem 4rem rgba(0, 0, 0, 0.18);
}

.auth-submit {
    width: 100%;
    margin-top: 0.35rem;
}

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

.user-admin-card {
    display: grid;
    grid-template-columns:
        minmax(14rem, 1fr)
        minmax(15rem, auto)
        auto;
    align-items: center;
    gap: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.1rem;
    background: var(--surface);
}

.user-admin-identity {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.user-admin-identity h2 {
    overflow: hidden;
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-avatar {
    width: 2.8rem;
    height: 2.8rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 0.8rem;
    background: var(--surface-soft);
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 900;
}

.user-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.status-badge-admin {
    border-color: rgba(201, 159, 82, 0.4);
    color: var(--accent);
}

.status-active {
    color: #8fd3a7;
}

.status-inactive {
    color: var(--text-muted);
    opacity: 0.75;
}

.user-admin-meta {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(7rem, 1fr));
    gap: 1rem;
    margin: 0;
}

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

.user-admin-meta dt {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.user-admin-meta dd {
    margin: 0;
    font-size: 0.78rem;
}

.user-form-card {
    max-width: 58rem;
    margin-inline: auto;
}

.user-form {
    display: grid;
    gap: 1.25rem;
}

.form-section-help {
    margin-top: -0.4rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.checkbox-disabled {
    opacity: 0.7;
}

@media (max-width: 1040px) {
    .header-content {
        align-items: flex-start;
    }

    .site-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .account-menu {
        width: 100%;
        justify-content: flex-end;
        border-left: 0;
        border-top: 1px solid var(--border);
        margin-left: 0;
        padding-top: 0.65rem;
        padding-left: 0;
    }

    .user-admin-card {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .user-admin-meta {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 760px) {
    .auth-layout {
        min-height: auto;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-block: 1.5rem;
    }

    .auth-intro h1 {
        max-width: none;
    }

    .user-admin-card {
        grid-template-columns: 1fr;
    }

    .user-admin-meta {
        grid-column: auto;
        grid-row: auto;
    }

    .user-admin-card > .action-row {
        width: 100%;
    }

    .user-admin-card > .action-row > * {
        flex: 1;
    }

    .user-admin-card > .action-row a,
    .user-admin-card > .action-row button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .account-menu {
        align-items: stretch;
        flex-direction: column;
    }

    .account-identity {
        text-align: left;
    }

    .account-menu form,
    .account-menu button {
        width: 100%;
    }

    .user-admin-meta {
        grid-template-columns: 1fr;
    }
}


/* Benutzergruppen und Berechtigungen */

.status-warning {
    color: #d8aa57;
}

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

.permission-group-card {
    display: grid;
    gap: 1.2rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.2rem;
    background: var(--surface);
}

.permission-group-card header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.permission-group-card h2 {
    margin: 0 0 0.45rem;
    font-size: 1.2rem;
}

.permission-group-card header p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.permission-group-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.permission-group-stats > div {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-soft);
}

.permission-group-stats strong,
.permission-group-stats span {
    display: block;
}

.permission-group-stats strong {
    color: var(--accent);
    font-size: 1.25rem;
}

.permission-group-stats span {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.permission-group-form-card {
    max-width: 72rem;
    margin-inline: auto;
}

.permission-group-form,
.permission-sections {
    display: grid;
    gap: 1.25rem;
}

.permission-section {
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 1rem;
    background: var(--surface-soft);
}

.permission-section legend {
    padding-inline: 0.45rem;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

.permission-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.85rem;
    background: var(--surface);
    cursor: pointer;
}

.permission-checkbox:hover {
    border-color: var(--accent);
}

.permission-checkbox input {
    margin-top: 0.2rem;
}

.permission-checkbox span,
.permission-checkbox strong,
.permission-checkbox small {
    display: block;
}

.permission-checkbox strong {
    margin-bottom: 0.2rem;
    font-size: 0.86rem;
}

.permission-checkbox small {
    color: var(--text-muted);
    line-height: 1.4;
}

.account-password-layout {
    min-height: min(68vh, 42rem);
}

@media (max-width: 820px) {
    .permission-group-grid,
    .permission-checkbox-grid {
        grid-template-columns: 1fr;
    }
}


/* Datenbank-Backups */

.backup-page-header {
    align-items: flex-end;
}

.backup-warning {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(201, 159, 82, 0.38);
    border-radius: 1rem;
    padding: 1rem 1.15rem;
    background: rgba(201, 159, 82, 0.07);
}

.backup-warning-icon {
    width: 2.1rem;
    height: 2.1rem;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(201, 159, 82, 0.55);
    border-radius: 999px;
    color: var(--accent);
    font-weight: 900;
}

.backup-warning strong {
    display: block;
    margin-bottom: 0.25rem;
}

.backup-warning p {
    max-width: 52rem;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.backup-list {
    display: grid;
    gap: 1rem;
}

.backup-card {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1rem, 3vw, 1.4rem);
    background: var(--surface);
}

.backup-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.backup-card-header h2 {
    overflow-wrap: anywhere;
    margin: 0.55rem 0 0;
    font-size: 1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.backup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.backup-size {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.65rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.backup-meta {
    display: grid;
    grid-template-columns:
        minmax(10rem, 0.8fr)
        minmax(10rem, 0.8fr)
        minmax(15rem, 1.4fr);
    gap: 1rem;
    margin: 0 0 1.1rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.backup-meta div {
    display: grid;
    gap: 0.2rem;
}

.backup-meta dt {
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.backup-meta dd {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
}

.backup-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

@media (max-width: 760px) {
    .backup-page-header {
        align-items: stretch;
    }

    .backup-page-header > form,
    .backup-page-header > form button {
        width: 100%;
    }

    .backup-card-header {
        flex-direction: column;
    }

    .backup-meta {
        grid-template-columns: 1fr;
    }

    .backup-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .backup-actions > *,
    .backup-actions a,
    .backup-actions button {
        width: 100%;
    }
}


/* Änderungsprotokoll */

.audit-page-header {
    align-items: flex-end;
}

.audit-count {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.audit-filter-card {
    display: grid;
    grid-template-columns:
        minmax(14rem, 1.5fr)
        minmax(10rem, 0.8fr)
        minmax(10rem, 0.8fr)
        minmax(10rem, 0.8fr)
        auto;
    align-items: end;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--surface);
}

.audit-filter-actions {
    display: flex;
    gap: 0.55rem;
}

.audit-list {
    display: grid;
    gap: 0.8rem;
}

.audit-card {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(12rem, auto)
        auto;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition:
        border-color 160ms ease,
        transform 160ms ease,
        background 160ms ease;
}

.audit-card:hover {
    border-color: rgba(201, 159, 82, 0.5);
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.audit-card-main {
    min-width: 0;
}

.audit-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.audit-card h2 {
    overflow: hidden;
    margin: 0.55rem 0 0.25rem;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-card p {
    overflow: hidden;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-card-meta {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(7rem, 1fr));
    gap: 1rem;
    margin: 0;
}

.audit-card-meta div,
.audit-detail-meta div {
    display: grid;
    gap: 0.15rem;
}

.audit-card-meta dt,
.audit-detail-meta dt {
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.audit-card-meta dd,
.audit-detail-meta dd {
    margin: 0;
    font-size: 0.8rem;
}

.audit-card-arrow {
    color: var(--accent);
    font-size: 1.15rem;
}

.audit-action-create,
.audit-action-backup_create {
    color: #8fd3a7;
}

.audit-action-update,
.audit-action-password_change,
.audit-action-password_reset {
    color: var(--accent);
}

.audit-action-delete,
.audit-action-backup_delete {
    color: #e59a9a;
}

.audit-action-backup_restore {
    color: #9eb8e8;
}

.pagination {
    display: grid;
    grid-template-columns:
        minmax(7rem, 1fr)
        auto
        minmax(7rem, 1fr);
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.pagination > :last-child {
    justify-self: end;
}

.pagination-status {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

.audit-detail-card {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1rem, 4vw, 1.6rem);
    background: var(--surface);
}

.audit-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.audit-detail-header h1 {
    overflow-wrap: anywhere;
    margin: 0.65rem 0 0.35rem;
}

.audit-detail-header p {
    max-width: 52rem;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.audit-event-number {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
}

.audit-detail-meta {
    display: grid;
    grid-template-columns:
        repeat(5, minmax(8rem, 1fr));
    gap: 1rem;
    margin: 1.35rem 0 0;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.audit-change-section {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1rem, 3vw, 1.35rem);
    background: var(--surface);
}

.audit-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.audit-section-header h2 {
    margin: 0.15rem 0 0;
    font-size: 1.15rem;
}

.audit-change-count {
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.42rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.audit-change-list {
    display: grid;
    gap: 0.75rem;
}

.audit-change-row {
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: 0.8rem;
    padding: 0.9rem;
    background: rgba(0, 0, 0, 0.1);
}

.audit-change-row h3 {
    margin: 0 0 0.75rem;
    color: var(--text);
    font-size: 0.82rem;
}

.audit-change-changed {
    border-left-color: var(--accent);
}

.audit-change-added {
    border-left-color: #8fd3a7;
}

.audit-change-removed {
    border-left-color: #df8b8b;
}

.audit-change-values {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);
    align-items: stretch;
    gap: 0.65rem;
}

.audit-change-value {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    padding: 0.7rem;
    background: var(--surface-soft);
}

.audit-change-value span {
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.audit-change-value strong {
    overflow-wrap: anywhere;
    font-size: 0.88rem;
    line-height: 1.45;
}

.audit-change-arrow {
    align-self: center;
    color: var(--accent);
    font-size: 1.15rem;
    font-weight: 900;
}

.audit-no-change {
    border: 1px dashed var(--border);
    border-radius: 0.8rem;
    padding: 1rem;
    text-align: center;
}

.audit-no-change p {
    margin: 0.35rem 0 0;
    color: var(--text-muted);
}

.audit-full-comparison {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface);
}

.audit-full-comparison > summary {
    cursor: pointer;
    padding: 1rem 1.15rem;
    color: var(--text);
    font-weight: 800;
    list-style-position: inside;
}

.audit-full-comparison[open] > summary {
    border-bottom: 1px solid var(--border);
}

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

.audit-payload-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--surface-soft);
}

.audit-payload-card > header {
    margin-bottom: 0.9rem;
}

.audit-payload-card h2 {
    margin: 0.15rem 0 0;
    font-size: 1rem;
}

.audit-readable-fields {
    display: grid;
    gap: 0;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
}

.audit-readable-row {
    display: grid;
    grid-template-columns:
        minmax(8rem, 0.38fr)
        minmax(0, 1fr);
    gap: 0.8rem;
    padding: 0.72rem 0.8rem;
    border-bottom: 1px solid var(--border);
}

.audit-readable-row:last-child {
    border-bottom: 0;
}

.audit-readable-row dt {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.audit-readable-row dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.audit-readable-fields-compact {
    margin-top: 0.75rem;
}

.audit-readable-fields-compact .audit-readable-row {
    grid-template-columns:
        minmax(7rem, 0.32fr)
        minmax(0, 1fr);
    padding: 0.55rem 0.65rem;
}

.audit-readable-value {
    white-space: pre-wrap;
}

.audit-readable-empty,
.audit-empty-payload {
    color: var(--text-muted);
}

.audit-component-list {
    display: grid;
    gap: 0.7rem;
}

.audit-component {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.1);
}

.audit-component-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.audit-component-header strong {
    display: block;
    overflow-wrap: anywhere;
}

.audit-component-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.audit-component-measure {
    flex: 0 0 auto;
    border: 1px solid rgba(201, 159, 82, 0.45);
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.audit-component-note {
    margin: 0.7rem 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.audit-component-breakdown {
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 0.65rem;
}

.audit-component-breakdown > summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
}

.audit-component-breakdown[open] > summary {
    margin-bottom: 0.65rem;
}

.audit-component-breakdown .audit-component {
    background: rgba(0, 0, 0, 0.14);
}

.audit-step-list {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.audit-step-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.1);
}

.audit-step-number {
    width: 1.65rem;
    height: 1.65rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--accent);
    color: #151515;
    font-size: 0.72rem;
    font-weight: 900;
}

.audit-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.audit-generic-list {
    display: grid;
    gap: 0.65rem;
}

.audit-generic-item {
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.08);
}

.audit-empty-payload {
    margin: 0;
}

@media (max-width: 1120px) {
    .audit-filter-card {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .audit-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .audit-card {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .audit-card-meta {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .audit-detail-meta {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .audit-page-header {
        align-items: stretch;
    }

    .audit-count {
        align-self: flex-start;
    }

    .audit-filter-card {
        grid-template-columns: 1fr;
    }

    .audit-filter-actions {
        grid-column: auto;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .audit-filter-actions > * {
        width: 100%;
    }

    .audit-card {
        grid-template-columns:
            minmax(0, 1fr)
            auto;
    }

    .audit-card-meta {
        grid-template-columns: 1fr;
    }

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

    .pagination > *,
    .pagination > :last-child {
        justify-self: stretch;
        text-align: center;
    }

    .audit-detail-header {
        flex-direction: column;
    }

    .audit-detail-meta {
        grid-template-columns: 1fr;
    }

    .audit-comparison {
        grid-template-columns: 1fr;
    }

    .audit-section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .audit-change-values {
        grid-template-columns: 1fr;
    }

    .audit-change-arrow {
        justify-self: center;
        transform: rotate(90deg);
    }

    .audit-readable-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .audit-component-header {
        flex-direction: column;
    }

    .audit-component-measure {
        align-self: flex-start;
    }
}


/* Kalkulierbare Garnituren */

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

.garnish-form-heading p {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.garnish-form-grid {
    display: grid;
    grid-template-columns:
        minmax(12rem, 1fr)
        minmax(13rem, 0.9fr)
        minmax(13rem, 1fr);
    gap: 0.8rem;
}

.garnish-component-editor {
    display: grid;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.85rem;
    background: rgba(0, 0, 0, 0.08);
}

.garnish-component-editor[hidden] {
    display: none;
}

.garnish-component-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.garnish-component-rows {
    display: grid;
    gap: 0.65rem;
}

.garnish-component-row {
    display: grid;
    grid-template-columns:
        minmax(12rem, 1.35fr)
        minmax(6rem, 0.55fr)
        minmax(6rem, 0.55fr)
        minmax(9rem, 0.8fr)
        auto;
    align-items: end;
    gap: 0.65rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.garnish-component-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.garnish-remove-component {
    min-height: 2.7rem;
}

.garnish-admin-list {
    display: grid;
    gap: 0.8rem;
}

.garnish-admin-card {
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    padding: 0.75rem;
    background: var(--surface-soft);
}

.garnish-admin-card > details > summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem;
    list-style: none;
}

.garnish-admin-card > details > summary::-webkit-details-marker {
    display: none;
}

.garnish-admin-card > details[open] > summary {
    margin-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.85rem;
}

.garnish-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.garnish-summary-action {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
}

.garnish-delete-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}

.ingredient-usage-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

@media (max-width: 980px) {
    .garnish-form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .garnish-note-field {
        grid-column: 1 / -1;
    }

    .garnish-component-row {
        grid-template-columns:
            minmax(12rem, 1fr)
            minmax(6rem, 0.5fr)
            minmax(6rem, 0.5fr);
    }

    .garnish-component-row .field:nth-of-type(4) {
        grid-column: 1 / -2;
    }
}

@media (max-width: 680px) {
    .garnish-form-grid,
    .garnish-component-row {
        grid-template-columns: 1fr;
    }

    .garnish-note-field,
    .garnish-component-row .field:nth-of-type(4) {
        grid-column: auto;
    }

    .garnish-component-heading,
    .garnish-admin-card > details > summary {
        align-items: stretch;
        flex-direction: column;
    }

    .garnish-component-heading button,
    .garnish-remove-component,
    .garnish-delete-form,
    .garnish-delete-form button {
        width: 100%;
    }
}


/* Layout-Korrektur für Garniturformulare */

.garnish-cost-form > .button-primary {
    justify-self: start;
    width: auto;
    min-width: 12rem;
}

.garnish-component-editor {
    min-width: 0;
}

.garnish-component-rows,
.garnish-component-row {
    min-width: 0;
}

.garnish-component-row > .field {
    min-width: 0;
}

.garnish-component-row input,
.garnish-component-row select {
    width: 100%;
    min-width: 0;
}

.garnish-remove-component {
    align-self: end;
    width: auto;
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .garnish-component-row {
        grid-template-columns:
            minmax(12rem, 1.4fr)
            minmax(7rem, 0.6fr)
            minmax(7rem, 0.6fr)
            minmax(10rem, 1fr);
    }

    .garnish-remove-component {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

@media (max-width: 760px) {
    .garnish-cost-form > .button-primary {
        justify-self: stretch;
        width: 100%;
    }

    .garnish-remove-component {
        justify-self: stretch;
        width: 100%;
    }
}


/* Garniturformular: einspaltiges Layout und gemeinsame Aktionsleiste */

.admin-create-form.garnish-cost-form {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
}

.garnish-component-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.garnish-component-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
}

.garnish-component-actions .button-primary,
.garnish-component-actions .button-secondary {
    width: auto;
    min-width: 0;
    white-space: nowrap;
}

@media (max-width: 680px) {
    .garnish-component-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .garnish-component-actions {
        display: grid;
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .garnish-component-actions .button-primary,
    .garnish-component-actions .button-secondary {
        width: 100%;
        white-space: normal;
    }
}

@media (max-width: 460px) {
    .garnish-component-actions {
        grid-template-columns: 1fr;
    }
}


/* Cocktail-Suche und kombinierbare Filter */

.cocktail-filter-card {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(0.9rem, 3vw, 1.2rem);
    background: var(--surface);
}

.cocktail-filter-form {
    display: grid;
    gap: 0.9rem;
}

.cocktail-search-row {
    display: grid;
    grid-template-columns:
        minmax(14rem, 1fr)
        auto
        auto;
    align-items: end;
    gap: 0.75rem;
}

.cocktail-search-field {
    min-width: 0;
}

.cocktail-search-field input {
    width: 100%;
}

.cocktail-advanced-filters {
    border-top: 1px solid var(--border);
    padding-top: 0.8rem;
}

.cocktail-advanced-filters > summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 800;
    list-style-position: inside;
}

.cocktail-advanced-filters[open] > summary {
    margin-bottom: 0.9rem;
}

.cocktail-filter-grid {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(10rem, 1fr));
    gap: 0.75rem;
}

.cocktail-filter-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 0.9rem;
    border-top: 1px solid var(--border);
    padding-top: 0.9rem;
}

.active-filter-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 1.25rem;
}

.active-filter-heading {
    margin-right: 0.2rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid rgba(201, 159, 82, 0.4);
    border-radius: 999px;
    padding: 0.42rem 0.68rem;
    background: rgba(201, 159, 82, 0.07);
    color: var(--text);
    font-size: 0.76rem;
}

.active-filter-chip strong {
    color: var(--accent);
}

.cocktail-card-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: auto;
}

@media (max-width: 1080px) {
    .cocktail-filter-grid {
        grid-template-columns:
            repeat(3, minmax(10rem, 1fr));
    }
}

@media (max-width: 780px) {
    .cocktail-search-row {
        grid-template-columns: 1fr 1fr;
    }

    .cocktail-search-field {
        grid-column: 1 / -1;
    }

    .cocktail-filter-grid {
        grid-template-columns:
            repeat(2, minmax(10rem, 1fr));
    }
}

@media (max-width: 540px) {
    .cocktail-search-row,
    .cocktail-filter-grid {
        grid-template-columns: 1fr;
    }

    .cocktail-search-field {
        grid-column: auto;
    }

    .cocktail-search-row > *,
    .cocktail-search-row button,
    .cocktail-search-row a,
    .cocktail-filter-footer > *,
    .cocktail-filter-footer button,
    .cocktail-filter-footer a {
        width: 100%;
    }

    .cocktail-filter-footer {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cocktail-advanced-filters > summary {
        align-items: flex-start;
    }
}


/* Zutatengruppen und Zutatenkategorien */
.taxonomy-section { margin-top:1.25rem; border:1px solid var(--border); border-radius:1rem; padding:clamp(1rem,3vw,1.35rem); background:var(--surface); }
.taxonomy-section-header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.taxonomy-section-header h2 { margin:.15rem 0 .35rem; }
.taxonomy-section-header p:last-child { margin:0; color:var(--text-muted); }
.taxonomy-create-form,.taxonomy-edit-form { display:grid; grid-template-columns:minmax(12rem,1fr) minmax(14rem,1.4fr) minmax(6rem,.35fr) auto auto; align-items:end; gap:.75rem; }
.taxonomy-create-form { margin-bottom:1rem; border:1px solid var(--border); border-radius:.85rem; padding:.9rem; background:var(--surface-soft); }
.taxonomy-category-form { grid-template-columns:minmax(12rem,1fr) minmax(12rem,1fr) minmax(6rem,.35fr) auto auto; }
.taxonomy-list { display:grid; gap:.75rem; }
.taxonomy-card { border:1px solid var(--border); border-radius:.85rem; padding:.85rem; background:var(--surface-soft); }
.taxonomy-card .taxonomy-edit-form { grid-template-columns:minmax(12rem,1fr) minmax(14rem,1.4fr) minmax(6rem,.35fr) auto minmax(10rem,auto) auto; }
.taxonomy-card .taxonomy-category-form { grid-template-columns:minmax(12rem,1fr) minmax(12rem,1fr) minmax(6rem,.35fr) auto minmax(7rem,auto) auto; }
.taxonomy-active-field { align-self:center; margin-bottom:.45rem; }
.taxonomy-usage { display:flex; flex-wrap:wrap; gap:.35rem; align-self:center; }
.taxonomy-delete-form { display:flex; justify-content:flex-end; margin-top:.75rem; border-top:1px solid var(--border); padding-top:.75rem; }
@media (max-width:1100px) {
 .taxonomy-create-form,.taxonomy-category-form,.taxonomy-card .taxonomy-edit-form,.taxonomy-card .taxonomy-category-form { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .taxonomy-description-field,.taxonomy-usage { grid-column:1/-1; }
}
@media (max-width:620px) {
 .taxonomy-section-header { flex-direction:column; }
 .taxonomy-create-form,.taxonomy-category-form,.taxonomy-card .taxonomy-edit-form,.taxonomy-card .taxonomy-category-form { grid-template-columns:1fr; }
 .taxonomy-description-field,.taxonomy-usage { grid-column:auto; }
 .taxonomy-create-form button,.taxonomy-edit-form button,.taxonomy-delete-form,.taxonomy-delete-form button { width:100%; }
}


/* Bearbeitbare Cocktailmerkmale */

.characteristic-section {
    margin-top: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: clamp(1rem, 3vw, 1.35rem);
    background: var(--surface);
}

.characteristic-create-form,
.characteristic-edit-form {
    display: grid;
    grid-template-columns:
        minmax(10rem, 1fr)
        minmax(14rem, 1.5fr)
        minmax(6rem, 0.35fr)
        auto
        auto;
    align-items: end;
    gap: 0.75rem;
}

.characteristic-create-form {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.9rem;
    background: var(--surface-soft);
}

.characteristic-list,
.characteristic-assignment-list {
    display: grid;
    gap: 0.75rem;
}

.characteristic-card,
.characteristic-assignment-card {
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    padding: 0.85rem;
    background: var(--surface-soft);
}

.characteristic-edit-form {
    grid-template-columns:
        minmax(10rem, 1fr)
        minmax(14rem, 1.5fr)
        minmax(6rem, 0.35fr)
        auto
        auto
        auto;
}

.characteristic-assignment-card {
    display: grid;
    grid-template-columns:
        minmax(12rem, 0.7fr)
        minmax(18rem, 2fr)
        auto;
    align-items: center;
    gap: 1rem;
}

.characteristic-checkboxes,
.cocktail-characteristics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.characteristic-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.38rem 0.62rem;
    background: var(--surface);
    font-size: 0.78rem;
    cursor: pointer;
}

.characteristic-chip {
    border: 1px solid rgba(201, 159, 82, 0.4);
    border-radius: 999px;
    padding: 0.3rem 0.55rem;
    background: rgba(201, 159, 82, 0.08);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
}

@media (max-width: 1000px) {
    .characteristic-create-form,
    .characteristic-edit-form,
    .characteristic-assignment-card {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .characteristic-description,
    .characteristic-checkboxes {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .characteristic-create-form,
    .characteristic-edit-form,
    .characteristic-assignment-card {
        grid-template-columns: 1fr;
    }

    .characteristic-description,
    .characteristic-checkboxes {
        grid-column: auto;
    }

    .characteristic-create-form button,
    .characteristic-edit-form button,
    .characteristic-assignment-card button {
        width: 100%;
    }
}
