/**
 * PfotenPanel - Dark Theme mit Pfoten-Stil
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    /* Farben */
    --bg-primary: #1a1a2e;
    --bg-secondary: rgba(22, 33, 62, 0.5);
    --bg-card: rgba(31, 41, 64, 0.5);
    --bg-input: #2a3550;
    --bg-hover: #2d3a52;

    --text-primary: #eaeaea;
    --text-secondary: #a0a8b8;
    --text-muted: #6b7280;

    --accent: #e94560;
    --accent-hover: #ff6b6b;
    --accent-soft: rgba(233, 69, 96, 0.15);

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.15);

    --border: #2d3a52;
    --shadow: rgba(0, 0, 0, 0.3);

    /* Pfoten-Hintergrund Opacity */
    --paw-opacity: 0.12;

    /* Abstände */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Radien */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Übergänge */
    --transition: 0.2s ease;

    /* Header Höhe */
    --header-height: 56px;

    /* Safe Area für iPhone */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: rgba(255, 255, 255, 0.5);
    --bg-card: rgba(255, 255, 255, 0.5);
    --bg-input: #f0f0f0;
    --bg-hover: #e8e8e8;

    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;

    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);

    --paw-opacity: 0.08;
}

/* Light Theme nutzt dieselbe --paw-opacity Variable */

/* Theme Toggle Icons */
.icon-sun,
.icon-moon {
    transition: var(--transition);
}

.hidden {
    display: none !important;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: calc(var(--header-height) + var(--safe-area-top));
    padding-bottom: var(--safe-area-bottom);
    position: relative;
}

/* ============================================
   Header
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(var(--header-height) + var(--safe-area-top));
    padding-top: var(--safe-area-top);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: var(--text-primary);
}

.header-logo svg {
    width: 28px;
    height: 28px;
    fill: var(--accent);
}

.header-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.header-nav {
    display: flex;
    gap: var(--spacing-xs);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: var(--spacing-xs) var(--spacing-sm);
    gap: 2px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.nav-label {
    font-size: 0.625rem;
    font-weight: 500;
}

.nav-btn:hover, .nav-btn.active {
    background: var(--bg-hover);
    color: var(--accent);
}

.nav-btn svg {
    width: 22px;
    height: 22px;
}

/* Mobile-Buttons Wrapper (im Header) */
.header-actions-mobile {
    display: none;
    margin-left: auto;
    gap: var(--spacing-xs);
}

/* Theme-Toggle Mobile (im Header) */
.theme-toggle-mobile {
    background: var(--bg-hover);
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    cursor: pointer;
    color: var(--text-primary);
}

.theme-toggle-mobile svg {
    width: 20px;
    height: 20px;
    display: block;
}

.theme-toggle-mobile .hidden {
    display: none;
}

/* Pfoten-Toggle aktiver Zustand */
.paw-toggle svg {
    fill: var(--accent);
    transition: var(--transition);
}

.paw-toggle.paw-animated svg {
    fill: var(--accent);
    filter: drop-shadow(0 0 4px var(--accent));
}

/* ============================================
   Container & Layout
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.page-title svg {
    width: 28px;
    height: 28px;
    fill: var(--accent);
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: 0 2px 8px var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-title svg {
    width: 20px;
    height: 20px;
    fill: var(--accent);
}

/* ============================================
   Dashboard Grid
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.widget-title svg {
    width: 18px;
    height: 18px;
    fill: var(--accent);
}

.widget-body {
    padding: var(--spacing-md);
    max-height: 300px;
    overflow-y: auto;
}

.widget-footer {
    padding: var(--spacing-sm) var(--spacing-md);
    border-top: 1px solid var(--border);
    text-align: center;
}

.widget-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.widget-link:hover {
    text-decoration: underline;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn svg {
    width: 18px;
    height: 18px;
}

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

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

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.btn-danger:hover {
    background: var(--accent-soft);
}

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

.btn-success:hover {
    background: #0ea271;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 1rem;
}

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

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a0a8b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

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

.form-row {
    display: flex;
    gap: var(--spacing-md);
}

.form-row .form-group {
    flex: 1;
}

.form-inline {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-end;
}

.form-inline .form-group {
    margin-bottom: 0;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ============================================
   Lists
   ============================================ */
.list {
    list-style: none;
}

.list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.list-item-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.list-item.checked .list-item-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* ============================================
   Board Entries
   ============================================ */
.board-entry {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.board-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.board-entry-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

.board-entry-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.board-entry-text {
    font-size: 0.9375rem;
    line-height: 1.4;
}

.board-entry.done .board-entry-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.board-entry-actions {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border);
}

/* Board Comments */
.board-comments {
    display: none;
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border);
}

.board-entry.comments-open .board-comments {
    display: block;
}

.board-comments-empty {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: var(--spacing-xs) 0;
}

.board-comment {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--border);
}

.board-comment:last-child {
    border-bottom: none;
}

.board-comment-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: 2px;
}

.board-comment-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
}

.board-comment-date {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.board-comment-delete {
    margin-left: auto;
    padding: 2px;
    opacity: 0.4;
}

.board-comment-delete:hover {
    opacity: 1;
}

.board-comment-text {
    font-size: 0.875rem;
    line-height: 1.3;
}

.board-comment-add {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.board-comment-add .form-input {
    flex: 1;
    font-size: 0.875rem;
    padding: var(--spacing-xs) var(--spacing-sm);
}

.board-comment-toggle svg {
    fill: currentColor;
}

/* ============================================
   Shopping List
   ============================================ */
.shopping-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-xs);
}

.shopping-item-checkbox {
    width: 22px;
    height: 22px;
    accent-color: var(--success);
    cursor: pointer;
}

.shopping-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.shopping-item-name {
    font-weight: 500;
}

.shopping-item-source {
    font-size: 0.7rem;
    color: var(--accent);
    opacity: 0.7;
    font-style: italic;
}

.shopping-item-source::before {
    content: '↳ ';
}

.shopping-item-amount {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
}

.shopping-item.checked {
    opacity: 0.5;
}

.shopping-item.checked .shopping-item-name {
    text-decoration: line-through;
}

/* ============================================
   Meal Plan
   ============================================ */
.mealplan-day {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}

.mealplan-day.today {
    border-left: 3px solid var(--accent);
}

.mealplan-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.mealplan-day-date {
    font-weight: 600;
}

.mealplan-day.today .mealplan-day-date {
    color: var(--accent);
}

.mealplan-recipe {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.mealplan-recipe-img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-input);
}

.mealplan-recipe-info {
    flex: 1;
}

.mealplan-recipe-title {
    font-weight: 500;
}

.mealplan-recipe-title.cooked {
    text-decoration: line-through;
    color: var(--text-muted);
}

.mealplan-recipe-servings {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mealplan-empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.875rem;
}

/* ============================================
   Recipe Cards
   ============================================ */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.recipe-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.recipe-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.recipe-card-body {
    padding: var(--spacing-md);
}

.recipe-card-title {
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recipe-card-servings {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recipe-card-delete {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.recipe-card:hover .recipe-card-delete {
    opacity: 1;
}

.recipe-card-delete:hover {
    background: var(--accent);
}

.recipe-card-delete svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Recipe Detail
   ============================================ */
.recipe-detail {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: 0 1px 3px var(--shadow);
}

.recipe-hero {
    position: relative;
    height: 250px;
    margin: calc(-1 * var(--spacing-md));
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.recipe-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.recipe-hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.recipe-meta {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.recipe-meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.recipe-meta-item svg {
    width: 18px;
    height: 18px;
    fill: var(--accent);
}

.recipe-section {
    margin-bottom: var(--spacing-xl);
}

.recipe-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--accent);
}

/* Ingredients Table */
.ingredients-table {
    width: 100%;
    border-collapse: collapse;
}

.ingredients-table th,
.ingredients-table td {
    padding: var(--spacing-sm);
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.ingredients-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

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

.ingredients-table .amount {
    width: 60px;
    text-align: right;
    font-weight: 500;
}

.ingredients-table .unit {
    width: 60px;
    color: var(--text-secondary);
}

.ingredients-table .pantry {
    width: 80px;
    text-align: center;
}

/* Steps */
.recipe-steps {
    list-style: none;
    counter-reset: step;
}

.recipe-step {
    position: relative;
    padding-left: 50px;
    margin-bottom: var(--spacing-lg);
}

.recipe-step::before {
    content: counter(step);
    counter-increment: step;
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.step-image {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin-top: var(--spacing-sm);
}

/* ============================================
   Calendar
   ============================================ */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.calendar-month {
    font-size: 1.25rem;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calendar-header {
    background: var(--bg-secondary);
    padding: var(--spacing-sm);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.calendar-day {
    background: var(--bg-card);
    min-height: 80px;
    padding: var(--spacing-xs);
    cursor: pointer;
    transition: var(--transition);
}

.calendar-day:hover {
    background: var(--bg-hover);
}

.calendar-day.other-month {
    opacity: 0.4;
}

.calendar-day.today {
    background: var(--accent-soft);
}

.calendar-day-number {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.calendar-day.today .calendar-day-number {
    color: var(--accent);
}

.calendar-event {
    font-size: 0.6875rem;
    padding: 2px 4px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: var(--spacing-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-top: 1px solid var(--border);
}

/* ============================================
   Badge
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 99px;
    text-transform: uppercase;
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge-accent {
    background: var(--accent-soft);
    color: var(--accent);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--spacing-md);
    fill: var(--text-muted);
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.9375rem;
}

/* ============================================
   Autocomplete
   ============================================ */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.autocomplete-list.active {
    display: block;
}

.autocomplete-item {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: var(--transition);
}

.autocomplete-item:hover {
    background: var(--bg-hover);
}

.autocomplete-item-name {
    font-weight: 500;
}

.autocomplete-item-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: calc(var(--spacing-lg) + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    animation: toast-in 0.3s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--accent);
}

.toast svg {
    width: 20px;
    height: 20px;
}

.toast.success svg {
    fill: var(--success);
}

.toast.error svg {
    fill: var(--accent);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    @page {
        size: A4 portrait;
        margin: 15mm;
    }

    /* Einkaufszettel in DIN A5 Hochformat */
    body[data-page="shopping"] {
        page: shopping;
    }

    @page shopping {
        size: A5 portrait;
        margin: 10mm;
    }

    body {
        background: white !important;
        color: #2a2a2a !important;
        padding: 0 !important;
        font-size: 10pt !important;
    }

    /* --- Pfoten-Wasserzeichen (dezent im Druck) --- */
    body::after {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
        z-index: -1;
        opacity: 1;
        background-image: url('../images/paw-pattern.svg');
        background-size: 120px 120px;
        background-repeat: repeat;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* --- Seitentitel mit Akzent --- */
    .page-title {
        font-size: 14pt !important;
        margin-bottom: 10px !important;
        padding-bottom: 6px !important;
        border-bottom: 2px solid #e94560 !important;
        color: #2a2a2a !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page-title svg {
        width: 18px !important;
        height: 18px !important;
        fill: #e94560 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .header,
    .btn,
    .nav-btn,
    .modal-overlay,
    .toast-container,
    form,
    .form-group,
    .form-row,
    .form-inline,
    #price-estimate-container,
    #paw-canvas {
        display: none !important;
    }

    .card,
    .widget,
    .board-entry,
    .mealplan-day {
        background: white !important;
        box-shadow: none !important;
        border: 1px solid #e0e0e0 !important;
        border-radius: 6px !important;
        page-break-inside: avoid;
    }

    /* --- Einkaufsliste --- */
    .shopping-item {
        padding: 3px 0 !important;
        font-size: 10pt !important;
        border: none !important;
        border-bottom: 1px dotted #ccc !important;
        margin-bottom: 0 !important;
        background: transparent !important;
    }

    .shopping-item-checkbox {
        width: 14px !important;
        height: 14px !important;
        accent-color: #e94560;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Zweispaltig für Einkaufsliste */
    #shopping-items {
        column-count: 2;
        column-gap: 20px;
    }

    .shopping-item.checked {
        display: none !important;
    }

    /* --- Rezepte --- */
    .recipe-hero {
        height: 180px !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }

    .recipe-step::before {
        background: #e94560 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a {
        color: #2a2a2a !important;
        text-decoration: none !important;
    }

    /* --- Wochenplan kompakt --- */
    .mealplan-day {
        padding: 4px 8px !important;
        margin-bottom: 4px !important;
        font-size: 9pt !important;
    }

    .mealplan-recipe-img {
        width: 30px !important;
        height: 30px !important;
        border-radius: 4px !important;
    }
}

/* ============================================
   Tooltip
   ============================================ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1001;
    pointer-events: none;
    margin-bottom: 4px;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
    /* Theme-Toggle und Pfoten-Toggle im Header anzeigen */
    .header-actions-mobile {
        display: flex;
    }

    /* Theme-Toggle und Pfoten-Toggle in der Nav verstecken */
    #theme-toggle,
    #paw-toggle {
        display: none;
    }

    /* Mobile Bottom-Navigation */
    .header-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        background: var(--bg-primary);
        border-top: 1px solid var(--border);
        border-bottom: none;
        padding: var(--spacing-sm);
        padding-bottom: calc(var(--spacing-sm) + var(--safe-area-bottom));
        justify-content: space-around;
        z-index: 1000;
    }

    body {
        padding-bottom: calc(70px + var(--safe-area-bottom));
    }

    /* Tooltips oben anzeigen auf Mobile */
    [data-tooltip]::after {
        bottom: auto;
        top: -40px;
    }

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

    .recipe-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .recipe-card-img {
        height: 100px;
    }

    .form-row {
        flex-direction: column;
    }

    .calendar-day {
        min-height: 60px;
    }

    .calendar-event {
        font-size: 0.5625rem;
    }

    .modal {
        max-width: 100%;
        margin: var(--spacing-sm);
    }
}

/* ============================================
   Loading State
   ============================================ */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

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

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

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
}

.tab {
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab:hover {
    color: var(--text-primary);
}

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

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

/* ============================================
   Week Navigation
   ============================================ */
.week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    gap: var(--spacing-md);
}

.week-nav-title {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

.week-nav-btns {
    display: flex;
    gap: var(--spacing-xs);
}

/* ============================================
   Confirm Dialog
   ============================================ */
.confirm-text {
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

/* ============================================
   Transfer Status
   ============================================ */
.transfer-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--success-soft);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.transfer-status svg {
    width: 20px;
    height: 20px;
    fill: var(--success);
}

.transfer-status-text {
    color: var(--success);
    font-weight: 500;
    font-size: 0.875rem;
}

/* ============================================
   Ingredient Pantry Status
   ============================================ */
.ingredient-pantry {
    color: var(--success);
}

.ingredient-pantry .ingredient-name {
    color: var(--success);
}

.ingredient-pantry td {
    background: var(--success-soft);
}

.pantry-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    color: var(--success);
    text-transform: uppercase;
    font-weight: 600;
}

.pantry-indicator svg {
    width: 12px;
    height: 12px;
    fill: var(--success);
}

/* Pantry Check Modal Items */
.pantry-check-item {
    transition: background var(--transition);
}

.pantry-check-item:hover {
    background: var(--bg-hover);
}

.pantry-check-item:hover .pantry-add-icon {
    fill: var(--accent) !important;
}

.pantry-check-item:active {
    transform: scale(0.98);
}

/* ============================================
   Pantry List (Vorratsliste Accordion)
   ============================================ */
.pantry-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pantry-item {
    border-bottom: 1px solid var(--border);
}

.pantry-item:last-child {
    border-bottom: none;
}

.pantry-item-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) 0;
}

.pantry-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.pantry-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pantry-item-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 0.1rem 0.35rem;
    white-space: nowrap;
}

.pantry-synonym-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: color var(--transition);
}

.pantry-synonym-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.pantry-toggle-arrow {
    transition: transform 0.2s ease;
}

.pantry-item.expanded .pantry-toggle-arrow {
    transform: rotate(90deg);
}

.pantry-synonyms {
    display: none;
    padding: 0 0 var(--spacing-sm) calc(24px + var(--spacing-xs));
}

.pantry-item.expanded .pantry-synonyms {
    display: block;
}

.pantry-synonym-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--spacing-xs) 0;
}

.pantry-synonym-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pantry-synonym-entry span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pantry-primary-badge {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: normal;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 0.05rem 0.3rem;
    margin-left: 0.25rem;
}

.pantry-synonym-add {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

.pantry-synonym-add .form-input {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
}

.btn-xs {
    width: 24px;
    height: 24px;
    padding: 0;
    min-width: unset;
}

/* ============================================
   Recipe Tags
   ============================================ */
.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.tag-chip:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.tag-chip.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
}

.tag-chip svg {
    width: 14px;
    height: 14px;
}

.tag-chip svg path {
    fill: currentColor;
}

/* Tag Filter Bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.filter-bar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Recipe Card Tags */
.recipe-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: var(--spacing-xs);
}

.recipe-card-tag {
    font-size: 0.625rem;
    padding: 2px 6px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 99px;
}

/* ============================================
   Favorite Star
   ============================================ */
.favorite-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.favorite-star:hover {
    background: var(--bg-hover);
}

.favorite-star svg {
    width: 24px;
    height: 24px;
    transition: var(--transition);
}

.favorite-star svg path {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1.5;
    transition: var(--transition);
}

.favorite-star.active svg path {
    fill: var(--warning) !important;
    stroke: var(--warning);
}

.favorite-star:hover svg path {
    stroke: var(--warning);
}

.favorite-star:hover svg {
    transform: scale(1.1);
}

.favorite-star.active:hover svg path {
    fill: var(--warning) !important;
}

/* Recipe Card Favorite */
.recipe-card-favorite {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1;
}

.recipe-card-favorite svg {
    width: 16px;
    height: 16px;
    transition: var(--transition);
}

.recipe-card-favorite svg path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.7);
    stroke-width: 2;
    transition: var(--transition);
}

.recipe-card-favorite.active svg path {
    fill: var(--warning) !important;
    stroke: var(--warning);
}

.recipe-card-favorite:hover svg path {
    stroke: var(--warning);
}

.recipe-card-favorite.active:hover svg path {
    fill: var(--warning) !important;
    stroke: var(--warning);
}

/* Tag Multi-Select */
.tag-select {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    min-height: 44px;
}

.tag-select .tag-chip {
    background: var(--bg-secondary);
}

.tag-select .tag-chip.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Recipe Detail Tags */
.recipe-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.recipe-tag {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Favorite Toggle in Forms */
.favorite-toggle {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.favorite-toggle:hover {
    background: var(--bg-hover);
}

.favorite-toggle.active {
    background: var(--warning-soft);
    border-color: var(--warning);
}

.favorite-toggle svg {
    width: 20px;
    height: 20px;
}

.favorite-toggle svg path {
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1.5;
}

.favorite-toggle.active svg path {
    fill: var(--warning) !important;
    stroke: var(--warning);
}

.favorite-toggle-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.favorite-toggle.active .favorite-toggle-text {
    color: var(--warning);
}
