/* ══════════════════════════════════════════════════════════════════════════
   FamilyPlanner – Design: Warme Brauntöne
   ══════════════════════════════════════════════════════════════════════════ */

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

:root {
  /* ── Primärfarben: warmes Braun ──────────────────────────────────── */
  --primary:       #8B5E3C;   /* Hauptbraun */
  --primary-dark:  #6D4A2E;   /* Hover/Aktiv */
  --primary-light: #C4956A;   /* Hell-Braun */
  --primary-xlight:#F0E0CC;   /* Sehr helles Braun */

  /* ── Akzent: warmes Terrakotta ───────────────────────────────────── */
  --accent:        #B5714A;
  --accent-light:  #E8C5A0;

  /* ── Status ──────────────────────────────────────────────────────── */
  --success:       #5A8A5A;   /* Gedämpftes Grün */
  --success-light: #D4EAD4;
  --warning:       #C4892A;   /* Warmes Gelb-Braun */
  --warning-light: #F5E4C0;
  --danger:        #B04040;   /* Gedämpftes Rot */
  --danger-light:  #F0D0D0;

  /* ── Hintergründe ────────────────────────────────────────────────── */
  --bg:            #FAF6F1;   /* Creme-Weiß */
  --bg-warm:       #F5EDE0;   /* Warmes Beige */
  --card:          #FFFCF8;   /* Fast weiß, leicht warm */
  --card-warm:     #FDF5EC;   /* Warme Karte */

  /* ── Sidebar: dunkles Walnuss-Braun ──────────────────────────────── */
  --sidebar-bg:    #3D2B1F;
  --sidebar-hover: #5C3D28;
  --sidebar-active:#8B5E3C;

  /* ── Text ────────────────────────────────────────────────────────── */
  --text:          #3D2B1F;   /* Dunkles Braun */
  --text-light:    #8B7355;   /* Mittleres Braun */
  --text-muted:    #B09878;   /* Helles Braun */

  /* ── Rahmen & Schatten ───────────────────────────────────────────── */
  --border:        #E8D5BE;   /* Warmes Beige-Grau */
  --border-dark:   #C4A882;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 2px 12px rgba(61,43,31,.08);
  --shadow-md:     0 4px 20px rgba(61,43,31,.12);
  --shadow-lg:     0 8px 32px rgba(61,43,31,.16);

  /* ── Layout ──────────────────────────────────────────────────────── */
  --sidebar-w:     248px;
  --topbar-h:      58px;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 200; overflow-y: auto;
  transition: transform .28s ease;
  box-shadow: 3px 0 20px rgba(0,0,0,.15);
}
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh; display: flex; flex-direction: column;
}
.top-bar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(61,43,31,.06);
}
.page-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.content-area { padding: 1.5rem; flex: 1; }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: .25rem; flex-direction: column; gap: 5px; }
.menu-toggle-bar { display: block; width: 22px; height: 2.5px; background: var(--text); border-radius: 2px; transition: .25s; }
.sidebar-open .menu-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-open .menu-toggle-bar:nth-child(2) { opacity: 0; }
.sidebar-open .menu-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.sidebar-overlay { display: none; }

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar-logo {
  display: flex; align-items: center; gap: .8rem;
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.logo-text { color: #F0E0CC; font-weight: 800; font-size: 1.05rem; letter-spacing: .01em; }
.sidebar-section { padding: .6rem .5rem; flex: 1; }
.sidebar-heading { color: rgba(176,152,120,.7); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: .6rem .75rem .2rem; }
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .85rem; border-radius: var(--radius-sm);
  color: #C4A882; text-decoration: none; font-size: .88rem; font-weight: 500;
  transition: background .15s, color .15s; margin-bottom: 2px;
}
.nav-item:hover  { background: var(--sidebar-hover); color: #F0E0CC; }
.nav-item.active { background: var(--sidebar-active); color: #FFFCF8; font-weight: 600; }
.nav-icon { font-size: 1.05rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-sub  { padding-left: 2.5rem; font-size: .82rem; }
.sidebar-footer {
  padding: .85rem; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: .6rem;
  position: sticky; bottom: 0;
  background: var(--sidebar-bg);
  margin-top: auto;
  z-index: 1;
}
.user-info { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #FAF6F1; font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name { color: #F0E0CC; font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: rgba(176,152,120,.7); font-size: .68rem; text-transform: uppercase; }
.btn-logout { color: #8B7355; text-decoration: none; font-size: 1.1rem; padding: .3rem; border-radius: 6px; transition: color .15s; flex-shrink: 0; }
.btn-logout:hover { color: var(--danger); }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border: 1px solid var(--border);
}
.card-warm {
  background: var(--card-warm);
  border-color: var(--border-dark);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-header h3 { font-size: 1rem; font-weight: 700; }
.mt-1 { margin-top: .35rem; }
.mt-2 { margin-top: .75rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.ml-2 { margin-left: .5rem; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .52rem 1rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 600; cursor: pointer;
  text-decoration: none; border: 1.5px solid var(--border-dark);
  background: var(--card); color: var(--text);
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap; user-select: none;
}
.btn:hover        { border-color: var(--primary-light); background: var(--primary-xlight); }
.btn:active       { transform: scale(.98); }
.btn-primary      { background: var(--primary); color: #FFFCF8; border-color: var(--primary); }
.btn-primary:hover{ background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success      { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger       { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #963030; }
.btn-warning      { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-sm           { padding: .3rem .7rem; font-size: .8rem; border-radius: 6px; }
.btn-block        { width: 100%; justify-content: center; }
.btn-icon         { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .83rem; font-weight: 700; color: var(--text-light); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .04em; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=url], input[type=month],
input[type=color], textarea, select {
  width: 100%; padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem; font-family: inherit;
  background: var(--card); color: var(--text);
  transition: border-color .15s, background .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card-warm);
  box-shadow: 0 0 0 3px rgba(139,94,60,.12);
}
textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }
.form-row .form-group.flex-2 { flex: 2; }
.form-actions {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border);
}
.inline-form { display: flex; gap: .5rem; align-items: flex-end; }
.inline-form input { width: auto; flex: 1; }
small { font-size: .78rem; }

/* ── Toolbar ────────────────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.toolbar-filter { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-left: auto; }
.toolbar-filter input, .toolbar-filter select { width: auto; }
.search-input { min-width: 160px; }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge { display: inline-block; padding: .18rem .6rem; border-radius: 99px; font-size: .73rem; font-weight: 700; }
.badge-sm { padding: .1rem .4rem; font-size: .68rem; }
.badge-success { background: var(--success-light); color: #2D6B2D; }
.badge-warning { background: var(--warning-light); color: #7A5010; }
.badge-danger  { background: var(--danger-light);  color: #7A2020; }
.badge-brown   { background: var(--primary-xlight); color: var(--primary-dark); }
.badge         { background: var(--primary-xlight); color: var(--primary-dark); }

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flash { padding: .8rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; border: 1.5px solid; }
.flash-info    { background: #EFF3F0; color: #3A6040; border-color: #B8D8B8; }
.flash-success { background: var(--success-light); color: #2D5A2D; border-color: #9DC89D; }
.flash-warning { background: var(--warning-light); color: #7A5010; border-color: #DFB870; }
.flash-danger  { background: var(--danger-light);  color: #7A2020; border-color: #D0A0A0; }

/* ── Text helpers ───────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }

/* ── PWA extras ─────────────────────────────────────────────────────────── */
.connection-status { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; background: var(--success); transition: background .3s; flex-shrink: 0; }
.connection-status.offline { background: var(--danger); animation: blink 1.2s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.pwa-install-btn { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #FFFCF8; border: none; }
body { padding-bottom: env(safe-area-inset-bottom, 0px); }
.sidebar { padding-top: env(safe-area-inset-top, 0px); }

/* ── Bottom Navigation ──────────────────────────────────────────────────── */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--sidebar-bg); border-top: 1px solid rgba(255,255,255,.1); padding-bottom: env(safe-area-inset-bottom, 0px); z-index: 200; justify-content: space-around; align-items: stretch; }
.bottom-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .12rem; padding: .5rem .25rem; flex: 1; color: #8B7355; text-decoration: none; font-size: .62rem; font-weight: 600; transition: color .15s; }
.bottom-nav-item.active { color: var(--primary-light); }
.bottom-nav-icon { font-size: 1.25rem; line-height: 1; }

/* ── Auth page ──────────────────────────────────────────────────────────── */
body.auth-page { background: var(--bg-warm); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-wrapper { width: 100%; max-width: 400px; padding: 1rem; }
.auth-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 2.25rem; border: 1.5px solid var(--border); }
.auth-logo { text-align: center; margin-bottom: .75rem; }
.auth-title { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: .25rem; color: var(--text); }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.dashboard-welcome { margin-bottom: 1.5rem; }
.dashboard-welcome h2 { font-size: 1.35rem; font-weight: 800; color: var(--text); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 1rem; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 1.25rem 1rem;
  box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  border-left: 4px solid var(--border-dark);
  border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex; flex-direction: column; gap: .35rem;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-blue   { border-left-color: var(--primary); }
.stat-orange { border-left-color: var(--accent); }
.stat-green  { border-left-color: var(--success); }
.stat-purple { border-left-color: #8B6A3E; }
.stat-icon   { font-size: 1.5rem; }
.stat-value  { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--primary-dark); }
.stat-label  { font-size: .75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.event-list  { list-style: none; }
.event-item  { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.event-item:last-child { border: none; }
.event-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.event-info  { display: flex; flex-direction: column; }
.event-info strong { font-size: .88rem; }
.event-info small  { color: var(--text-muted); font-size: .76rem; }
.module-cards { display: flex; gap: .85rem; flex-wrap: wrap; }
.module-card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1rem 1.35rem; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: .75rem; font-weight: 600; transition: border-color .15s, background .15s, box-shadow .15s; }
.module-card:hover { border-color: var(--primary); background: var(--primary-xlight); box-shadow: var(--shadow); }
.module-card-icon { font-size: 1.35rem; }

/* ── Calendar ───────────────────────────────────────────────────────────── */
.calendar-grid { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border); }
.cal-header { display: grid; grid-template-columns: repeat(7,1fr); background: var(--sidebar-bg); }
.cal-header > div { padding: .65rem 0; text-align: center; color: #C4A882; font-size: .78rem; font-weight: 700; }
.cal-body { display: grid; grid-template-columns: repeat(7,1fr); }
.cal-cell { min-height: 90px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .4rem; overflow: hidden; background: var(--card); }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-empty { background: var(--bg); }
.cal-today { background: var(--primary-xlight); }
.cal-day-num { font-size: .78rem; font-weight: 700; color: var(--text-muted); margin-bottom: .2rem; }
.cal-today .cal-day-num { color: var(--primary); font-size: .88rem; }
.cal-event { font-size: .7rem; font-weight: 600; color: #fff; border-radius: 4px; padding: .14rem .35rem; margin-bottom: 2px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .15s; }
.cal-event:hover { opacity: .82; }
.cal-legend { display: flex; gap: 1rem; margin-bottom: .6rem; font-size: .8rem; }
.cal-legend-item { display: flex; align-items: center; gap: .4rem; color: var(--text-muted); }
.cal-legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ── COOKBOOK – Index ───────────────────────────────────────────────────── */
.recipe-count { font-size: .85rem; color: var(--text-muted); }
.fav-filter { display: inline-flex; align-items: center; gap: .25rem; padding: .45rem .85rem; border: 1.5px solid var(--border-dark); border-radius: var(--radius-sm); cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--text-muted); transition: .15s; }
.fav-filter.active { border-color: var(--warning); color: #7A5010; background: var(--warning-light); }

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.recipe-card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); overflow: hidden; transition: box-shadow .18s, transform .18s, border-color .18s; display: flex; flex-direction: column; }
.recipe-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary-light); }
.recipe-card-img { height: 160px; background-size: cover; background-position: center; background-color: var(--bg-warm); }
.recipe-card-img-placeholder { display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.recipe-card-body { padding: .9rem; flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.recipe-card-top { display: flex; align-items: center; justify-content: space-between; }
.recipe-card-body h3 { font-size: .95rem; font-weight: 700; color: var(--text); }
.recipe-desc { font-size: .82rem; color: var(--text-muted); flex: 1; }
.recipe-meta { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .76rem; color: var(--text-muted); margin-top: .35rem; }
.recipe-rating { color: var(--warning); font-weight: 700; }
.fav-star { font-size: .9rem; }

/* ── COOKBOOK – Recipe Detail ───────────────────────────────────────────── */
.recipe-detail { max-width: 960px; }
.recipe-hero { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--sidebar-bg); margin-bottom: 1.25rem; min-height: 220px; }
.recipe-hero-img { width: 100%; max-height: 380px; object-fit: cover; display: block; }
.recipe-hero-placeholder { height: 220px; display: flex; align-items: center; justify-content: center; font-size: 5rem; background: var(--bg-warm); }
.recipe-hero-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 1.5rem; background: linear-gradient(transparent, rgba(40,25,10,.8)); color: #fff; }
.recipe-hero-title { font-size: 1.75rem; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.recipe-hero-rating { margin-top: .35rem; color: #F5CC70; font-size: 1.05rem; display: flex; align-items: center; gap: .3rem; }
.recipe-hero-actions { position: absolute; top: .75rem; right: .75rem; display: flex; gap: .4rem; }
.btn-icon { background: rgba(40,25,10,.5); border: none; color: #fff; backdrop-filter: blur(4px); }
.btn-icon:hover { background: rgba(40,25,10,.75); }
.badge-white { background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(4px); }

.recipe-chips { display: flex; gap: .65rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.chip { display: flex; align-items: center; gap: .6rem; background: var(--card-warm); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .85rem; }
.chip-icon { font-size: 1.2rem; }
.chip small { font-size: .68rem; color: var(--text-muted); display: block; text-transform: uppercase; letter-spacing: .04em; }
.chip strong { font-size: .88rem; font-weight: 700; display: block; }
.servings-control { display: flex; align-items: center; gap: .4rem; }
.scale-btn { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-dark); background: var(--bg); cursor: pointer; font-size: 1rem; line-height: 1; display: flex; align-items: center; justify-content: center; transition: .15s; }
.scale-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-xlight); }

.recipe-description { color: var(--text-muted); margin-bottom: 1.25rem; line-height: 1.7; font-style: italic; }
.recipe-layout { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; margin-bottom: 1.5rem; }
.recipe-ingredients { background: var(--card-warm); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1rem; height: fit-content; position: sticky; top: calc(var(--topbar-h) + .75rem); }
.recipe-section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .75rem; }
.recipe-section-header h2 { font-size: 1rem; font-weight: 700; }
.ing-group-header { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: .5rem 0 .25rem; border-top: 1px solid var(--border); margin-top: .4rem; }
.ing-list { list-style: none; }
.ing-row { display: flex; align-items: baseline; gap: .4rem; padding: .4rem 0; border-bottom: 1px dotted var(--border); font-size: .875rem; }
.ing-row:last-child { border: none; }
.ing-row.ing-done .ing-name, .ing-row.ing-done .ing-amount, .ing-row.ing-done .ing-unit { text-decoration: line-through; color: var(--text-muted); }
.ing-check input { cursor: pointer; accent-color: var(--primary); }
.ing-amount { font-weight: 700; min-width: 36px; flex-shrink: 0; color: var(--primary-dark); }
.ing-unit { color: var(--text-muted); min-width: 28px; flex-shrink: 0; font-size: .82rem; }
.ing-name { flex: 1; }
.ing-optional { opacity: .65; }
.ing-opt-badge { font-size: .65rem; background: var(--bg-warm); border-radius: 4px; padding: .1rem .35rem; color: var(--text-muted); flex-shrink: 0; }
.ing-to-list { margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.recipe-steps-area { }
.recipe-section-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text); }
.steps-list { list-style: none; display: flex; flex-direction: column; gap: .75rem; }
.step-item { display: flex; gap: 1rem; cursor: pointer; padding: .9rem; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--card); transition: background .15s, border-color .15s; }
.step-item:hover { border-color: var(--primary-light); background: var(--card-warm); }
.step-item.step-done { background: var(--success-light); border-color: var(--success); }
.step-item.step-done .step-content p { color: var(--text-muted); text-decoration: line-through; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #FFFCF8; font-weight: 800; font-size: .88rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-item.step-done .step-num { background: var(--success); }
.step-content { flex: 1; }
.step-title { display: block; font-weight: 700; margin-bottom: .35rem; color: var(--primary-dark); }
.step-content p { line-height: 1.7; font-size: .9rem; }
.step-timer { display: inline-flex; align-items: center; gap: .35rem; margin-top: .6rem; background: var(--primary-xlight); border: 1px solid var(--primary-light); color: var(--primary-dark); border-radius: 6px; padding: .25rem .65rem; font-size: .78rem; font-weight: 600; cursor: pointer; transition: .15s; }
.step-timer:hover { background: var(--primary); color: #FFFCF8; }
.recipe-notes { background: var(--warning-light); border-left: 4px solid var(--warning); border-radius: 6px; padding: .85rem 1rem; margin-top: 1.25rem; }
.recipe-notes h3 { font-size: .9rem; font-weight: 700; margin-bottom: .5rem; color: #7A5010; }
.recipe-source { font-size: .82rem; color: var(--text-muted); margin-top: 1rem; }
.recipe-source a { color: var(--primary); }
.recipe-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 1rem; grid-column: 1/-1; }
.tag { background: var(--primary-xlight); color: var(--primary-dark); border-radius: 99px; padding: .2rem .7rem; font-size: .78rem; font-weight: 600; text-decoration: none; }
.tag:hover { background: var(--primary-light); color: #fff; }
.timer-overlay { position: fixed; inset: 0; background: rgba(40,25,10,.55); display: flex; align-items: center; justify-content: center; z-index: 600; }
.timer-box { background: var(--card); border-radius: var(--radius); padding: 2.5rem 3rem; text-align: center; box-shadow: var(--shadow-lg); border: 2px solid var(--border); }
.timer-time { font-size: 4rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--primary); line-height: 1; margin-bottom: .5rem; }
.timer-label { color: var(--text-muted); font-size: .875rem; margin-bottom: 1.25rem; }
.timer-btns { display: flex; gap: .75rem; justify-content: center; }

/* Ratings */
.recipe-ratings-section { margin-top: 2rem; }
.recipe-ratings-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.ratings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .85rem; }
.rating-form-card { background: var(--card-warm); border: 1.5px solid var(--primary-light); border-radius: var(--radius); padding: 1rem; }
.rating-form-card h3 { font-size: .9rem; font-weight: 700; margin-bottom: .75rem; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .15rem; }
.star-input input { display: none; }
.star-input label { font-size: 1.6rem; color: var(--border-dark); cursor: pointer; transition: color .1s; }
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked ~ label { color: var(--warning); }
.rating-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem; }
.rating-card-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; flex-wrap: wrap; }
.rating-user { font-weight: 700; font-size: .875rem; }
.rating-stars { color: var(--warning); font-size: .9rem; }
.rating-date { font-size: .75rem; color: var(--text-muted); margin-left: auto; }
.rating-comment { font-size: .875rem; color: var(--text-muted); }

/* ── COOKBOOK – Recipe Form ─────────────────────────────────────────────── */
.url-import-bar { padding: 1rem 1.25rem; background: var(--card-warm); }
.url-import-row { display: flex; gap: .6rem; margin-top: .5rem; flex-wrap: wrap; }
.url-import-row input { flex: 1; min-width: 200px; }
.import-status { margin-top: .5rem; padding: .5rem .75rem; border-radius: 6px; font-size: .85rem; }
.import-loading { background: var(--primary-xlight); color: var(--primary-dark); }
.import-success { background: var(--success-light); color: #2D6B2D; }
.import-error   { background: var(--danger-light); color: #7A2020; }
.form-card { }
.form-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.form-section-title { font-size: .95rem; font-weight: 700; color: var(--primary-dark); }
.img-upload-area { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.ing-editor-header { display: none; }
.ing-editor-row { display: flex; align-items: center; gap: .4rem; margin-bottom: .35rem; padding: .35rem .25rem; border-radius: 6px; transition: background .15s; }
.ing-editor-row:hover { background: var(--bg-warm); }
.ing-editor-group-row { display: flex; align-items: center; gap: .6rem; background: var(--primary-xlight); border-radius: 6px; padding: .35rem .75rem; margin-bottom: .35rem; font-size: .875rem; }
.ing-editor-group-row input { flex: 1; background: transparent; border: none; border-bottom: 1.5px solid var(--border-dark); border-radius: 0; padding: .2rem; }
.ing-editor-group-row input:focus { outline: none; border-bottom-color: var(--primary); }
.drag-handle { color: var(--text-muted); cursor: grab; font-size: 1.1rem; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.opt-check { font-size: .72rem; color: var(--text-muted); display: flex; align-items: center; gap: .2rem; cursor: pointer; white-space: nowrap; }
.step-editor-row { display: flex; gap: .85rem; margin-bottom: .85rem; padding: .9rem; background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); }
.step-editor-num { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #FFFCF8; font-weight: 700; font-size: .85rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-editor-body { flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.step-editor-header { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.step-editor-body textarea { resize: vertical; min-height: 80px; }

/* ── SHOPPING ───────────────────────────────────────────────────────────── */
.list-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.list-card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); transition: box-shadow .15s, border-color .15s; display: flex; align-items: flex-start; gap: .75rem; padding: 1rem; }
.list-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-light); }
.list-card-icon { font-size: 1.5rem; flex-shrink: 0; }
.list-card-body { flex: 1; min-width: 0; }
.list-card-name { font-weight: 700; font-size: .95rem; margin-bottom: .4rem; }
.list-card-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.list-card-progress { width: 100%; height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: .35rem; }
.list-card-progress-fill { height: 100%; background: var(--success); border-radius: 99px; }
.shopping-header { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.shopping-list-title { font-size: 1.1rem; font-weight: 700; flex: 1; }
.shopping-actions { margin-left: auto; display: flex; gap: .5rem; }
.shopping-progress { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.progress-bar { flex: 1; height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--success); border-radius: 99px; transition: width .4s ease; }
.progress-label { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.add-item-card { overflow: hidden; }
.add-item-tabs { display: flex; border-bottom: 2px solid var(--border); }
.add-tab { flex: 1; padding: .65rem; background: none; border: none; cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--text-muted); transition: .15s; border-bottom: 2.5px solid transparent; margin-bottom: -2px; }
.add-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-xlight); }
.add-tab-content { padding: 1rem; }
.add-item-row { display: flex; gap: .5rem; margin-bottom: .5rem; align-items: center; flex-wrap: wrap; }
.add-item-row input[type=text] { width: auto; flex: 1; min-width: 120px; }
.cat-group { margin-bottom: .75rem; }
.cat-group-header { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: .3rem .25rem; margin-bottom: .25rem; border-bottom: 1px solid var(--border); }
.item-list { list-style: none; }
.item-row { display: flex; align-items: center; gap: .75rem; padding: .55rem .4rem; border-bottom: 1px solid var(--border); background: var(--card); border-radius: 6px; margin-bottom: 3px; transition: background .1s; }
.item-row:hover { background: var(--card-warm); }
.item-info { flex: 1; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.item-info strong { font-size: .9rem; }
.item-name-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.item-brand { font-size: .75rem; color: var(--text-muted); font-style: italic; }
.item-qty { font-size: .82rem; color: var(--text-muted); }
.item-info-done strong { text-decoration: line-through; color: var(--text-muted); }
.item-checked { opacity: .6; }
.check-btn { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-dark); background: none; cursor: pointer; font-size: .8rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: .15s; }
.check-btn:hover { border-color: var(--success); color: var(--success); }
.check-done { border-color: var(--success); background: var(--success); color: #fff; }
.delete-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: .9rem; padding: .25rem; border-radius: 4px; transition: color .15s; }
.delete-btn:hover { color: var(--danger); }
.section-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; margin-bottom: .5rem; }
.checked-title { color: var(--success); }

/* Scanner */
.barcode-scanner-area { min-height: 100px; }
.scanner-viewport { position: relative; border-radius: var(--radius-sm); overflow: hidden; background: #000; max-height: 300px; }
.scanner-viewport video { width: 100%; display: block; max-height: 300px; object-fit: cover; }
.scanner-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.scanner-crosshair { width: 200px; height: 140px; border: 3px solid rgba(255,255,255,.85); border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); animation: scanPulse 2s ease-in-out infinite; }
@keyframes scanPulse { 0%,100%{border-color:rgba(255,255,255,.7)} 50%{border-color:rgba(196,149,106,.9)} }
.scanner-hint { margin-top: .75rem; color: #fff; font-size: .82rem; font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.scanner-close { position: absolute; top: .5rem; right: .5rem; pointer-events: all; background: rgba(0,0,0,.6); color: #fff; border-color: transparent; }
.product-result-card { border: 1.5px solid var(--border-dark); border-radius: var(--radius-sm); overflow: hidden; margin-top: .75rem; }
.product-result-inner { display: flex; align-items: flex-start; gap: .75rem; padding: .75rem; background: var(--card-warm); }
.product-result-inner img { width: 72px; height: 72px; object-fit: contain; border-radius: 6px; border: 1px solid var(--border); }
.product-result-info { display: flex; flex-direction: column; gap: .2rem; }
.product-result-info strong { font-size: .95rem; }
.product-result-actions { display: flex; gap: .5rem; padding: .75rem; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--border); background: var(--card); }

/* Statistics */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.top-items-list { display: flex; flex-direction: column; gap: .45rem; }
.top-item-row { display: flex; align-items: center; gap: .6rem; }
.top-item-rank { font-size: .72rem; font-weight: 800; color: var(--text-muted); width: 18px; text-align: center; }
.top-item-name { font-size: .875rem; font-weight: 600; width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.top-item-bar  { flex: 1; height: 10px; background: var(--border); border-radius: 99px; overflow: hidden; }
.top-item-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; transition: width .6s ease; }
.top-item-count { font-size: .78rem; color: var(--text-muted); width: 28px; text-align: right; }
.purchases-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.purchases-table th { text-align: left; padding: .5rem .75rem; background: var(--bg-warm); border-bottom: 2px solid var(--border-dark); font-size: .73rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.purchases-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
.purchases-table tr:last-child td { border: none; }
.purchases-table tr:hover td { background: var(--card-warm); }

/* ── WOCHENPLAN ─────────────────────────────────────────────────────────── */
.wp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem; }
.wp-nav-center { display: flex; align-items: center; gap: .5rem; }
.wp-week-label { font-weight: 700; font-size: 1rem; }
.wp-generate-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; background: linear-gradient(135deg, var(--primary-xlight), var(--success-light)); border: 1.5px solid var(--primary-light); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.25rem; }
.wp-generate-bar-empty { background: var(--bg-warm); border-color: var(--border); justify-content: center; text-align: center; }
.wp-generate-info { display: flex; flex-direction: column; gap: .15rem; }
.wp-generate-count { font-weight: 700; font-size: 1rem; color: var(--primary-dark); }
.wp-merge-note { display: flex; align-items: flex-start; gap: .6rem; background: var(--warning-light); border: 1px solid #DFB870; border-radius: 8px; padding: .65rem .85rem; margin-top: .75rem; font-size: .82rem; color: #7A5010; }
.wp-recipe-summary { margin-bottom: .75rem; }
.wp-recipe-list { list-style: none; display: flex; flex-direction: column; gap: .25rem; }
.wp-recipe-list li { font-size: .875rem; padding: .25rem 0; border-bottom: 1px solid var(--border); }
.wp-recipe-list li:last-child { border: none; }
.wp-grid { display: grid; grid-template-columns: 100px repeat(7, 1fr); border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.wp-col { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.wp-col:last-child { border-right: none; }
.wp-label-col { background: var(--bg-warm); padding: .6rem .5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; min-height: 40px; }
.wp-day-header { text-align: center; padding: .5rem .25rem; background: var(--sidebar-bg); font-size: .8rem; color: #C4A882; }
.wp-day-name { display: block; font-weight: 700; color: #F0E0CC; }
.wp-day-date { display: block; font-size: .72rem; color: #8B7355; }
.wp-today-header { background: var(--sidebar-active); }
.wp-today-header .wp-day-name { color: #fff; }
.wp-today-header .wp-day-date { color: #F0E0CC; }
.wp-meal-icon { font-size: 1rem; }
.wp-meal-name { font-size: .7rem; color: var(--text-muted); font-weight: 600; text-align: center; }
.wp-cell { padding: .3rem; min-height: 80px; vertical-align: top; display: flex; flex-direction: column; gap: .25rem; }
.wp-today-cell { background: var(--primary-xlight); }
.wp-entry { background: var(--warning-light); border: 1px solid #DFB870; border-radius: 6px; padding: .3rem .4rem; font-size: .75rem; }
.wp-entry-title { display: block; font-weight: 600; color: #7A5010; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wp-entry-title:hover { text-decoration: underline; }
.wp-entry-note { display: block; color: #9A6830; font-size: .7rem; }
.wp-entry-actions { display: flex; align-items: center; gap: .25rem; margin-top: .15rem; }
.wp-delete-btn { background: none; border: none; cursor: pointer; color: #9A6830; font-size: .75rem; padding: 0; line-height: 1; }
.wp-delete-btn:hover { color: var(--danger); }
.wp-add-btn { margin-top: auto; width: 24px; height: 24px; border-radius: 50%; border: 1.5px dashed var(--border-dark); background: none; cursor: pointer; color: var(--text-muted); font-size: 1rem; line-height: 1; display: flex; align-items: center; justify-content: center; transition: .15s; align-self: flex-start; }
.wp-add-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-xlight); }
.wp-day-strip { display: none; gap: .35rem; overflow-x: auto; padding-bottom: .25rem; }
.wp-strip-day { flex-shrink: 0; width: 64px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--card); padding: .5rem .25rem; text-align: center; cursor: pointer; transition: .15s; }
.wp-strip-day:hover { border-color: var(--primary); }
.wp-strip-today { background: var(--primary-xlight); border-color: var(--primary); }
.wp-strip-name { display: block; font-size: .72rem; font-weight: 700; color: var(--text-muted); }
.wp-strip-date { display: block; font-size: .85rem; font-weight: 800; }
.wp-strip-count { display: block; font-size: .8rem; margin-top: .2rem; }

/* ── MODALS ─────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(40,25,10,.5); display: flex; align-items: center; justify-content: center; z-index: 500; padding: 1rem; }
.modal-box { background: var(--card); border-radius: var(--radius); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); border: 1.5px solid var(--border-dark); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); background: var(--card-warm); }
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); padding: .25rem; border-radius: 4px; }
.modal-close:hover { color: var(--danger); }
.recipe-picker { max-height: 200px; overflow-y: auto; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.recipe-option { display: flex; align-items: center; gap: .6rem; padding: .45rem .75rem; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .1s; }
.recipe-option:last-child { border: none; }
.recipe-option:hover { background: var(--primary-xlight); }
.recipe-option input[type=radio] { flex-shrink: 0; accent-color: var(--primary); }
.recipe-option-title { font-weight: 600; font-size: .875rem; flex: 1; }
.recipe-option-cat { font-size: .75rem; color: var(--text-muted); }

/* ── Recipe action panels ────────────────────────────────────────────────── */
.recipe-action-panels { margin-top: 1.5rem; display: flex; flex-direction: column; gap: .75rem; max-width: 760px; }
.action-panel { border: 1.5px solid var(--border-dark); border-radius: var(--radius); overflow: hidden; }
.action-panel-header { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; cursor: pointer; font-weight: 600; font-size: .9rem; background: var(--card-warm); transition: background .15s; user-select: none; }
.action-panel-header:hover { background: var(--primary-xlight); }
.action-panel-body { padding: 1rem; }
.hint { font-size: .78rem; color: var(--text-muted); display: block; margin-top: .2rem; }
.upcoming-meals { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: .75rem; }
.upcoming-meal-row { display: flex; align-items: center; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.upcoming-meal-row:last-child { border: none; }
.upcoming-date { color: var(--text-muted); font-size: .82rem; margin-left: auto; }

/* ── ADMIN ──────────────────────────────────────────────────────────────── */
.admin-tabs { display: flex; gap: .25rem; margin-bottom: 1.25rem; flex-wrap: wrap; background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: .35rem; overflow-x: auto; }
.admin-tab { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem .9rem; border-radius: var(--radius-sm); text-decoration: none; color: var(--text-muted); font-size: .875rem; font-weight: 600; white-space: nowrap; transition: .15s; }
.admin-tab:hover  { background: var(--bg-warm); color: var(--text); }
.admin-tab.active { background: var(--primary); color: #FFFCF8; }
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.admin-stat-card { background: var(--card-warm); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.admin-stat-val { font-size: 1.8rem; font-weight: 800; color: var(--primary-dark); line-height: 1; }
.admin-stat-lbl { font-size: .73rem; color: var(--text-muted); margin-top: .25rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-stat-warn { font-size: .65rem; color: var(--warning); margin-top: .2rem; }
.admin-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.admin-card { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.admin-card-hdr { font-weight: 700; font-size: .9rem; margin-bottom: .85rem; padding-bottom: .5rem; border-bottom: 2px solid var(--border); color: var(--primary-dark); }
.admin-card-wide { grid-column: 1 / -1; }
.admin-info-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.admin-info-table td { padding: .35rem .5rem; border-bottom: 1px solid var(--border); }
.admin-info-table td:first-child { color: var(--text-muted); width: 50%; }
.admin-info-table tr:last-child td { border: none; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.admin-table th { text-align: left; padding: .45rem .65rem; background: var(--bg-warm); border-bottom: 2px solid var(--border-dark); font-size: .73rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); white-space: nowrap; }
.admin-table td { padding: .5rem .65rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border: none; }
.admin-table tr:hover td { background: var(--card-warm); }
.module-list { display: flex; flex-direction: column; gap: .5rem; }
.module-item { display: flex; align-items: center; gap: .85rem; padding: .75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--card-warm); }
.module-item-icon { font-size: 1.5rem; flex-shrink: 0; }
.module-item-info { display: flex; flex-direction: column; flex: 1; gap: .1rem; }
.module-item-info strong { font-size: .9rem; }
.toggle-switch { position: relative; width: 40px; height: 22px; display: inline-block; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border-dark); border-radius: 99px; cursor: pointer; transition: .2s; }
.toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
input:checked + .toggle-slider { background: var(--success); }
input:checked + .toggle-slider::before { transform: translateX(18px); }
.user-avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #FFFCF8; font-weight: 700; font-size: .8rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); box-shadow: none;
             padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .sidebar-open .sidebar { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .sidebar-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(40,25,10,.5); z-index: 199; }
  .main-content { margin-left: 0; padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .menu-toggle  { display: flex; }
  .bottom-nav   { display: flex; }
  .sidebar-footer { position: sticky; bottom: 0; }
  .recipe-layout { grid-template-columns: 1fr; }
  .recipe-ingredients { position: static; }
  .form-row { flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .wp-grid { display: none; }
  .wp-day-strip { display: flex; }
  .charts-grid { grid-template-columns: 1fr; }
  .admin-row { grid-template-columns: 1fr; }
  .admin-tabs { gap: .15rem; }
  .admin-tab { padding: .4rem .6rem; font-size: .78rem; }
  .content-area { padding: 1rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .list-cards { grid-template-columns: 1fr; }
  .recipe-grid { grid-template-columns: 1fr; }
  .modal-box { margin: .5rem; max-height: calc(100vh - 1rem); }
  .top-bar { padding: 0 .75rem; }
  .recipe-hero-title { font-size: 1.2rem; }
}


