:root {
    /* Design tokens */
    --color-accent: #B5502E;
    --color-accent-dark: #944023;
    --color-accent-light: #D97B5A;
    --color-accent-tint: #F6E2DA;
    --color-accent-rgb: 181, 80, 46;

    /* "secondary" tokens: originally the old brand green, now a neutral
       warm sand/gray so red is the only accent color site-wide. */
    --color-secondary: #A69C8C;
    --color-secondary-dark: #8a8172;
    --color-secondary-light: #C4BBA9;
    --color-secondary-tint: #EFEAE2;
    --color-secondary-tint-dark: #E0D8C9;
    --color-secondary-text-dark: #6b6355;
    --color-secondary-rgb: 166, 156, 140;

    --color-bg-warm: #FBF1EC;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;

    /* Bootstrap overrides */
    --bs-primary: var(--color-accent);
    --bs-primary-rgb: var(--color-accent-rgb);
    --bs-btn-bg: var(--color-accent);
    --bs-btn-border-color: var(--color-accent);
    --bs-btn-hover-bg: var(--color-accent-dark);
    --bs-btn-hover-border-color: var(--color-accent-dark);
    --bs-link-color: var(--color-accent);
    --bs-link-hover-color: var(--color-accent-dark);
}

/* Login & Register */
.auth-page {
    background: linear-gradient(135deg, var(--color-accent-tint) 0%, var(--color-bg-warm) 100%);
}

.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 0.25rem rgba(var(--color-accent-rgb), 0.25);
}

/* Bootstrap's own component classes (e.g. .btn-primary) redeclare their
   --bs-btn-* custom properties locally with hardcoded values, so overriding
   --bs-primary etc. at :root alone does not reach them — override directly. */
a {
    color: var(--color-accent);
}

a:hover {
    color: var(--color-accent-dark);
}

.btn-primary {
    --bs-btn-bg: var(--color-accent);
    --bs-btn-border-color: var(--color-accent);
    --bs-btn-hover-bg: var(--color-accent-dark);
    --bs-btn-hover-border-color: var(--color-accent-dark);
    --bs-btn-active-bg: var(--color-accent-dark);
    --bs-btn-active-border-color: var(--color-accent-dark);
    --bs-btn-disabled-bg: var(--color-accent);
    --bs-btn-disabled-border-color: var(--color-accent);
    --bs-btn-focus-shadow-rgb: var(--color-accent-rgb);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

h1, h2, h3,
.recipe-short-desc,
.step-text {
    font-family: var(--font-display);
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: #333;
    background-color: #F5F3EE
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: #FAF9F6;
    color: #2c3e50;
    padding: 2rem 0;
    margin-bottom: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

header .subtitle {
    color: var(--color-accent);
    font-size: 1rem;
    font-weight: normal;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.back-link {
    display: inline-block;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--color-accent-dark);
}
        
.back-to-home {
    text-align: center;
    margin-top: 1.5rem;
}

.back-to-home a {
    color: #666;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.back-to-home a:hover {
    color: var(--color-accent-dark);
}

.no-recipes {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.recipe-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.recipe-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.recipe-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #e0e0e0;
}

.recipe-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recipe-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-secondary-light) 0%, var(--color-secondary) 100%);
    color: white;
    font-weight: 500;
}

.recipe-card-content {
    padding: 1.5rem;
}

.recipe-card-content h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.ingredient-count {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.recipe-card-actions {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    gap: 0.5rem;
}

.btn-edit {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--color-accent);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    flex: 1;
    text-align: center;
}

.btn-edit:hover {
    background-color: var(--color-accent-dark);
}

.recipe-detail {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.recipe-hero {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.recipe-hero-image {
    position: relative;
    flex: 1 1 400px;
    text-align: center;
}

.recipe-hero-image img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.recipe-hero-image figcaption {
    text-align: center;
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.recipe-hero-content {
    flex: 1 1 320px;
    padding-top: 0.5rem;
}

.recipe-hero-content h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    color: #1a1a1a;
    margin: 0;
}

.recipe-hero-content > .recipe-short-desc {
    margin-top: 1rem;
    margin-bottom: 0;
}

.recipe-breadcrumb {
    font-size: 0.875rem;
    color: #999;
    margin-bottom: 0.75rem;
}

.recipe-breadcrumb a {
    color: var(--color-secondary);
    text-decoration: none;
}

.recipe-breadcrumb a:hover {
    color: var(--color-secondary-dark);
}

.recipe-breadcrumb .breadcrumb-separator {
    margin: 0 0.5rem;
    color: #ccc;
}

.recipe-breadcrumb .breadcrumb-current {
    color: var(--color-accent);
    font-weight: 500;
}

.recipe-divider {
    border: none;
    border-top: 1px solid #e5e5e0;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .recipe-hero {
        flex-direction: column;
    }
}

.additional-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.additional-images-grid figure {
    margin: 0;
}

.additional-images-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.additional-images-grid figcaption {
    text-align: center;
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

.recipe-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.recipe-sidebar {
    flex: 0 0 320px;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
}

.recipe-main {
    flex: 1;
    min-width: 0;
}

.recipe-section {
    margin-bottom: 2rem;
}

.recipe-section h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-accent);
}

.ingredients-list {
    list-style: none;
    padding-left: 0;
}

.ingredients-list li {
    padding: 0.4rem 0;
}

.ingredient-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.ingredient-checkbox-input {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    accent-color: var(--color-secondary);
    cursor: pointer;
}

.ingredient-checkbox-input:checked ~ .ingredient-text {
    text-decoration: line-through;
    color: #999;
}

.steps-list {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
}

.steps-list li {
    counter-increment: step-counter;
    position: relative;
    background: var(--color-bg-warm);
    border-radius: 8px;
    padding: 2.5rem 1.5rem 1.5rem;
    margin-bottom: 1rem;
}

.steps-list li::before {
    content: counter(step-counter, decimal-leading-zero);
    position: absolute;
    left: 1.25rem;
    top: 0.25rem;
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-secondary-tint-dark);
    line-height: 1;
}

.steps-list .step-ingredients,
.steps-list .step-text {
    position: relative;
}

/* Schritt-Zutaten */
.step-ingredients {
    background-color: var(--color-secondary-tint);
    border-left: 3px solid var(--color-secondary);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
}

.step-ingredients-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.step-ingredient-pill {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background-color: var(--color-secondary);
    color: white;
    font-size: 0.875rem;
    border-radius: 999px;
    font-weight: 500;
}

.step-text {
    line-height: 1.6;
    color: #2c3e50;
}

footer {
    background-color: #FAF9F6;
    color: #2c3e50;
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 3rem;
    border-top: 1px solid #e5e5e0;
}

/* Suchfeld */
.search-container {
    position: relative;
    margin-bottom: 2rem;
    max-width: 1200px;
    align-items: center;
}

.search-clear {
    display: none;
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #999;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: 50%;
}

.search-clear:hover {
    color: #555;
    background: #f0f0f0;
}

.search-clear.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    max-width: 100%;
    padding: 1rem 2.5rem 1rem 1.5rem;
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    background-color: white;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

.search-input::placeholder {
    color: #999;
    opacity: 1;
}

/* Kategorie-Filter Buttons */
.category-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filter-btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-weight: 500;
    color: var(--color-secondary-text-dark);
    background-color: var(--color-secondary-tint);
    border: 2px solid var(--color-secondary-tint);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    text-align: center;
    line-height: 1;
}

.filter-btn:hover {
    background-color: var(--color-secondary-tint-dark);
    transform: translateY(-1px);
}

.filter-btn.active {
    background-color: var(--color-accent);
    color: white;
    font-weight: 600;
    border-color: var(--color-accent);
}

.filter-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.2);
}

/* Keine Ergebnisse Nachricht */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.no-results p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.no-results span {
    font-weight: bold;
    color: #2c3e50;
}

/* Bring! Import Button */
.btn-bring {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.875rem 1.5rem;
    background-color: #00b5ad;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 4px rgba(0, 181, 173, 0.3);
}

.btn-bring:hover {
    background-color: #009a93;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 181, 173, 0.4);
}

.btn-bring:active {
    transform: translateY(0);
}

/* Portionsrechner */
.portions-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background-color: var(--color-secondary);
    border-radius: 8px;
}

.portions-display {
    flex: 1;
    text-align: center;
    color: white;
    font-size: 1rem;
    font-weight: 500;
}

.portions-display span {
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-portion {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: white;
    color: var(--color-secondary);
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.2s;
    flex-shrink: 0;
}

.btn-portion:hover {
    background-color: #e0e0e0;
    transform: scale(1.05);
}

.btn-portion:active {
    transform: scale(0.95);
}

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

@media (max-width: 768px) {
    .recipe-hero-image img {
        max-height: 300px;
    }
    
    .recipe-content {
        flex-direction: column;
    }
    
    .recipe-sidebar {
        position: static;
        flex: 1;
    }
    
    .recipes-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .recipe-detail {
        padding: 1.5rem;
    }
    
    .recipe-content {
        flex-direction: column;
    }
    
    .recipe-sidebar {
        position: static;
        flex: 1;
        width: 100%;
    }
    
    .search-input {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .category-filter {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        flex: 1 1 auto;
        min-width: fit-content;
    }
}

/* Neue Styles für KochStudio-Design */
.recipe-short-desc {
    color: #666;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.recipe-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--color-secondary-tint);
    color: var(--color-secondary-text-dark);
    font-size: 0.75rem;
    border-radius: 999px;
    font-weight: 500;
}

.recipe-tags-overlay {
    position: absolute;
    left: 1rem;
    top: 1rem;
    margin: 0;
}

.recipe-tags-overlay .recipe-tag {
    background-color: rgba(255, 255, 255, 0.92);
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.recipe-card {
    position: relative;
}

.edit-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
    z-index: 10;
}

.edit-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Recipe Edit Button (Admin-only) */
.recipe-edit-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--color-accent);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    transition: all 0.2s ease;
    z-index: 10;
    opacity: 0.95;
}

.recipe-edit-btn:hover {
    background: #e55a28;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.5);
    opacity: 1;
}

.recipe-edit-btn svg {
    width: 40px;
    height: 40px;
}

/* Upload Zone Styles */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
    background-color: #f9fafb;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.upload-zone:hover {
    border-color: var(--color-accent);
    background-color: #fff5f1;
}

.upload-zone.drag-over {
    border-color: var(--color-accent);
    background-color: #fff5f1;
    transform: scale(1.02);
}

.upload-zone.uploading {
    opacity: 0.6;
    pointer-events: none;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.upload-text {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    margin: 0.5rem 0;
}

.upload-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

.upload-manual-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.upload-manual-link a {
    color: var(--color-accent);
    text-decoration: none;
    transition: all 0.2s;
}

.upload-manual-link a:hover {
    color: #e55a28;
    text-decoration: underline;
}

/* Image Preview in Cards */
.image-preview {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f3f4f6;
}

.image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.image-card .image-url[readonly] {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: default;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .upload-zone {
        padding: 1.5rem 0.75rem;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

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

/* ===== Sidebar & Dashboard Layout ===== */
.dashboard-layout,
.editor-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.dashboard-layout .sidebar,
.editor-sidebar {
    background: white;
    border-right: 1px solid #e5e7eb;
    padding: 2rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.user-info {
    color: #666;
    font-size: 0.875rem;
}

.user-info .username {
    font-weight: 600;
    color: #333;
}

.user-info .role {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--color-secondary-tint);
    color: var(--color-secondary);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    padding: 0 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: #F5F3EE;
    color: var(--color-accent);
}

.nav-link.active {
    background: var(--color-accent-tint);
    color: var(--color-accent);
    border-right: 3px solid var(--color-accent);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 1rem 1.5rem;
}

.dashboard-layout .main-content {
    padding: 2rem;
    max-width: 1400px;
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1000;
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
    .dashboard-layout,
    .editor-wrapper {
        grid-template-columns: 1fr;
    }

    .dashboard-layout .sidebar,
    .editor-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        width: 260px;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }

    .dashboard-layout .sidebar.open,
    .editor-sidebar.open {
        left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .dashboard-layout .main-content {
        padding: 5rem 1rem 1rem;
    }
}

/* ===== Dashboard ===== */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-accent);
}

.stat-card .subtitle {
    font-size: 0.875rem;
    color: #999;
}

.recipes-section {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.recipes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.recipes-header h2 {
    font-size: 1.25rem;
    margin: 0;
    color: #333;
}

.recipe-count {
    background: var(--color-secondary-tint);
    color: var(--color-secondary);
    padding: 0.35rem 0.875rem;
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 600;
}

.filter-container {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.filter-box {
    position: relative;
    width: 100%;
}

.filter-box input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
}

.filter-box input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

.filter-box svg {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.filter-box .clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    display: none;
    transition: color 0.2s;
}

.filter-box .clear-btn:hover {
    color: var(--color-accent);
}

.filter-box input:not(:placeholder-shown) ~ .clear-btn {
    display: block;
}

.filter-results-info {
    margin-top: 0.75rem;
    color: #666;
    font-size: 0.875rem;
}

.dashboard-page .recipes-grid {
    display: block !important;
    grid-template-columns: none !important;
    border: none;
    border-radius: 0;
    overflow: hidden;
    width: 100%;
    padding: 0;
    gap: 0;
    margin-bottom: 0;
}

.dashboard-page .recipes-grid table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.dashboard-page .recipes-grid th {
    background: #f9fafb;
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-page .recipes-grid th:first-child { width: 40%; }
.dashboard-page .recipes-grid th:nth-child(2) { width: 20%; }
.dashboard-page .recipes-grid th:nth-child(3) { width: 20%; text-align: center; }
.dashboard-page .recipes-grid th:last-child { width: 20%; text-align: right; }

.dashboard-page .recipe-card {
    cursor: pointer;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    transition: none;
}

.dashboard-page .recipe-card:hover {
    transform: none;
    box-shadow: none;
    background: #fafaf9;
}

.dashboard-page .recipe-card td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.dashboard-page .recipe-card td:nth-child(2) { text-align: center; }
.dashboard-page .recipe-card td:last-child { text-align: right; }

.dashboard-page tbody .recipe-card:last-child td {
    border-bottom: none;
}

.dashboard-page .recipe-card h3 {
    font-size: 1.0625rem;
    margin: 0 0 0.5rem 0;
    color: #333;
    font-weight: 600;
}

.dashboard-page .recipe-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.dashboard-page .recipe-card .tag {
    background: var(--color-secondary-tint);
    color: var(--color-secondary);
    padding: 0.3rem 0.875rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.dashboard-page .recipe-card .status {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
    white-space: nowrap;
}

.status-published {
    background: #d1fae5;
    color: #065f46;
}

.status-draft {
    background: #fee2e2;
    color: #991b1b;
}

.recipe-ingredients-count {
    color: #6b7280;
    font-size: 0.9375rem;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

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

.recipe-card.hidden {
    display: none;
}

/* ===== Admin ===== */
.invites-container {
    max-width: 100%;
}

.header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    font-size: 1.875rem;
    color: #333;
}

/* ===== Admin: Invites ===== */
.invites-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.invites-table table {
    width: 100%;
    border-collapse: collapse;
}

.invites-table thead {
    background: #f9fafb;
}

.invites-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.invites-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.invites-table tbody tr:last-child td {
    border-bottom: none;
}

.invites-table tbody tr:hover {
    background: #fafafa;
}

.code {
    font-family: monospace;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.badge-unused {
    background: #d1fae5 !important;
    color: #065f46 !important;
}

.badge-used {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

/* ===== Startseite: Filterleiste ===== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
}

.filter-bar .search-container {
    flex: 1;
    min-width: 260px;
    margin-bottom: 0;
}

.filter-dd-wrap {
    position: relative;
}

.filter-dd {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border: 2px solid var(--color-secondary-tint-dark);
    border-radius: 8px;
    background: white;
    color: #374151;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
}

.filter-dd:hover {
    background: var(--color-secondary-tint);
}

.filter-dd.on {
    border-color: var(--color-accent);
    background: var(--color-accent-tint);
    color: var(--color-accent);
}

.filter-dd b {
    background: var(--color-accent);
    color: white;
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 0 0.5rem;
    font-weight: 600;
}

.filter-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: 420px;
    max-width: calc(100vw - 40px);
    background: white;
    border: 1px solid var(--color-secondary-tint-dark);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 1rem 1.25rem;
    font-family: var(--font-body);
}

.filter-panel h3 {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.filter-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1.5rem;
    align-items: start;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0;
    font-size: 0.95rem;
    cursor: pointer;
    color: #333;
}

.filter-option input {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    accent-color: var(--color-accent);
    cursor: pointer;
}

.filter-option span {
    margin-left: auto;
    color: #9ca3af;
    font-size: 0.8rem;
}

.filter-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
}

.filter-panel-reset {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-secondary-text-dark);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: underline;
}

.filter-panel-reset:disabled {
    opacity: 0.5;
    cursor: default;
}

.filter-panel-apply {
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1.1rem;
    font-weight: 500;
    cursor: pointer;
}

.filter-panel-apply:hover {
    background: var(--color-accent-dark);
}

.filter-panel-sort {
    width: 200px;
    padding: 0.5rem;
}

.filter-sort-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    color: #333;
    cursor: pointer;
}

.filter-sort-item:hover {
    background: var(--color-secondary-tint);
}

.filter-sort-item.active {
    background: var(--color-accent-tint);
    color: var(--color-accent);
    font-weight: 600;
}

.filter-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    text-align: left;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem 0.35rem 0.9rem;
    background: var(--color-accent-tint);
    color: var(--color-accent-dark);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-chip button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(148, 64, 35, 0.15);
    color: inherit;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.filter-chip button:hover {
    background: rgba(148, 64, 35, 0.3);
}

.filter-reset-all {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: 0.875rem;
    margin-left: 0.5rem;
    cursor: pointer;
    padding: 0;
}

.filter-reset-all:hover {
    color: var(--color-accent-dark);
    text-decoration: underline;
}

.filter-count {
    margin-left: auto;
    color: #666;
    font-size: 0.875rem;
}

/* Karte: Beschreibung linksbündig, Tags oben rechts auf dem Bild */
.recipe-card-content .recipe-short-desc {
    text-align: left;
}

.recipe-card-tags {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    max-width: calc(100% - 1.5rem);
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.375rem;
    pointer-events: none;
}

.recipe-card-tags .recipe-tag {
    background-color: rgba(255, 255, 255, 0.92);
}

@media (max-width: 768px) {
    .filter-bar .search-container {
        flex-basis: 100%;
    }

    .filter-dd {
        padding: 0.75rem 1rem;
    }

    .filter-panel {
        right: auto;
        left: 0;
    }

    .filter-panel-sort {
        left: auto;
        right: 0;
    }

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

/* Fußzeile am unteren Fensterrand (Seiten mit footer): bei kurzem Inhalt unten, sonst hinter dem Inhalt */
body:has(> footer) {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 100vh;
}

body:has(> footer) > footer {
    margin-top: auto;
}
