/* ============================================================================
   Huys — designfundament (app.huys.app)
   Designtaal = macOS-app: glass + noise, Fraunces + DM Sans, 12 themes
   (licht <-> donker gepaard, identiek aan ThemeManager.swift).
   Fonts self-hosted (Fontsource woff2) — geen Google-CDN (AVG).
   ========================================================================== */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('../fonts/fraunces-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 300 500;
  font-display: swap;
  src: url('../fonts/fraunces-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url('../fonts/dmsans-normal.woff2') format('woff2');
}

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

:root {
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --radius-card: 16px;
  --radius-chip: 20px;
}

/* ===== THEMES (identiek aan macOS ThemeManager; licht <-> donker gepaard) ===== */
/* Linen (licht) <-> Graniet (donker) = standaardpaar */
body[data-theme="linen"] {
  --theme-gradient: linear-gradient(135deg, #f5f0e8 0%, #e8ddd0 40%, #d4c9b8 100%);
  --sidebar-bg: rgba(245, 240, 232, 0.7);
  --card-bg: rgba(255, 252, 247, 0.6);
  --border-color: rgba(180, 165, 145, 0.3);
  --text-primary: #2a2118;
  --text-muted: rgba(42, 33, 24, 0.45);
  --active-bg: rgba(255, 252, 247, 0.7);
  --accent-color: #8b6f47;
  --accent-bg: rgba(139, 111, 71, 0.12);
  --chip-bg: rgba(42, 33, 24, 0.06);
}
body[data-theme="graniet"] {
  --theme-gradient: linear-gradient(135deg, #282420 0%, #201c18 40%, #181410 100%);
  --sidebar-bg: rgba(32, 28, 24, 0.8);
  --card-bg: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 220, 160, 0.1);
  --text-primary: #e8e0d8;
  --text-muted: rgba(232, 224, 216, 0.38);
  --active-bg: rgba(255, 220, 160, 0.08);
  --accent-color: #d4a060;
  --accent-bg: rgba(212, 160, 96, 0.1);
  --chip-bg: rgba(255, 255, 255, 0.04);
}
/* Lavendel <-> Arduin */
body[data-theme="lavendel"] {
  --theme-gradient: linear-gradient(135deg, #ede8f5 0%, #ddd4f0 40%, #ccc0e8 100%);
  --sidebar-bg: rgba(237, 232, 245, 0.7);
  --card-bg: rgba(255, 253, 255, 0.6);
  --border-color: rgba(140, 110, 200, 0.2);
  --text-primary: #1e1430;
  --text-muted: rgba(30, 20, 48, 0.4);
  --active-bg: rgba(255, 253, 255, 0.7);
  --accent-color: #7040c0;
  --accent-bg: rgba(112, 64, 192, 0.1);
  --chip-bg: rgba(30, 20, 48, 0.05);
}
body[data-theme="arduin"] {
  --theme-gradient: linear-gradient(135deg, #2a3240 0%, #1e2a38 40%, #162030 100%);
  --sidebar-bg: rgba(30, 42, 56, 0.7);
  --card-bg: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-primary: #e8edf2;
  --text-muted: rgba(232, 237, 242, 0.4);
  --active-bg: rgba(255, 255, 255, 0.1);
  --accent-color: #6eb5ff;
  --accent-bg: rgba(110, 181, 255, 0.12);
  --chip-bg: rgba(255, 255, 255, 0.06);
}
/* Salie <-> Mosgroen */
body[data-theme="salie"] {
  --theme-gradient: linear-gradient(135deg, #e8ede6 0%, #d4ddd0 40%, #c0cdb8 100%);
  --sidebar-bg: rgba(232, 237, 230, 0.7);
  --card-bg: rgba(255, 255, 255, 0.55);
  --border-color: rgba(120, 145, 110, 0.25);
  --text-primary: #1e2a1a;
  --text-muted: rgba(30, 42, 26, 0.45);
  --active-bg: rgba(255, 255, 255, 0.65);
  --accent-color: #4a7c3f;
  --accent-bg: rgba(74, 124, 63, 0.12);
  --chip-bg: rgba(30, 42, 26, 0.06);
}
body[data-theme="mosgroen"] {
  --theme-gradient: linear-gradient(135deg, #1a2818 0%, #142210 40%, #0e1c0a 100%);
  --sidebar-bg: rgba(20, 34, 16, 0.8);
  --card-bg: rgba(255, 255, 255, 0.05);
  --border-color: rgba(100, 180, 80, 0.15);
  --text-primary: #c8e0c0;
  --text-muted: rgba(200, 224, 192, 0.4);
  --active-bg: rgba(100, 180, 80, 0.1);
  --accent-color: #7ec860;
  --accent-bg: rgba(126, 200, 96, 0.1);
  --chip-bg: rgba(255, 255, 255, 0.04);
}
/* Rijm <-> Nacht */
body[data-theme="rijm"] {
  --theme-gradient: linear-gradient(135deg, #eef3f8 0%, #dde8f0 40%, #ccd8e8 100%);
  --sidebar-bg: rgba(238, 243, 248, 0.75);
  --card-bg: rgba(255, 255, 255, 0.65);
  --border-color: rgba(100, 150, 200, 0.2);
  --text-primary: #142030;
  --text-muted: rgba(20, 32, 48, 0.4);
  --active-bg: rgba(255, 255, 255, 0.75);
  --accent-color: #2a72c0;
  --accent-bg: rgba(42, 114, 192, 0.1);
  --chip-bg: rgba(20, 32, 48, 0.05);
}
body[data-theme="nacht"] {
  --theme-gradient: linear-gradient(135deg, #0a0e1a 0%, #0d1525 40%, #0a1020 100%);
  --sidebar-bg: rgba(10, 14, 26, 0.8);
  --card-bg: rgba(255, 255, 255, 0.04);
  --border-color: rgba(100, 140, 255, 0.12);
  --text-primary: #c8d8f0;
  --text-muted: rgba(200, 216, 240, 0.35);
  --active-bg: rgba(100, 140, 255, 0.1);
  --accent-color: #4d8fff;
  --accent-bg: rgba(77, 143, 255, 0.1);
  --chip-bg: rgba(255, 255, 255, 0.04);
}

body {
  font-family: var(--font-body);
  min-height: 100vh;
  color: var(--text-primary);
  background: var(--theme-gradient) fixed;
  transition: background .4s, color .4s;
}

/* Noise-overlay zoals macOS-app */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: .4;
  pointer-events: none;
  z-index: 0;
}

.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  padding: 28px 0 20px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 400; letter-spacing: -0.5px;
  padding: 0 22px 24px; text-decoration: none; color: var(--text-primary);
}
.brand em { font-style: italic; color: var(--accent-color); }
.nav-section {
  font-size: 10px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 14px 22px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; margin: 1px 10px;
  font-size: 14px; color: var(--text-muted);
  border-radius: 10px; cursor: pointer;
  transition: background .15s, color .15s; text-decoration: none;
}
.nav-item:hover { background: var(--chip-bg); color: var(--text-primary); }
.nav-item.active { background: var(--active-bg); color: var(--text-primary); font-weight: 500; }
.nav-item .icon { width: 19px; height: 19px; flex-shrink: 0; opacity: .85; }

/* Phosphor SVG-icoon helper — kleurt mee via currentColor */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; fill: currentColor; }
svg.icon use { fill: currentColor; }
.nav-item .badge {
  margin-left: auto; background: var(--accent-bg); color: var(--accent-color);
  font-size: 11px; font-weight: 600; border-radius: 10px; padding: 2px 8px;
}

.sidebar-footer {
  margin-top: auto; padding: 14px 22px 0;
  border-top: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-color); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex-shrink: 0;
}
.user-meta { line-height: 1.3; }
.user-name { font-size: 13px; font-weight: 500; }
.user-house { font-size: 11px; color: var(--text-muted); }
.sidebar-footer form { margin-left: auto; }
.logout-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 17px; line-height: 1; padding: 4px;
}
.logout-btn:hover { color: var(--text-primary); }

/* ===== MAIN ===== */
.main { flex: 1; padding: 36px 44px 60px; max-width: 1180px; }
.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 30px;
}
.greeting { font-family: var(--font-display); font-size: 34px; font-weight: 300; letter-spacing: -0.5px; }
.greeting em { font-style: italic; color: var(--accent-color); }
.page-title { font-family: var(--font-display); font-size: 30px; font-weight: 300; letter-spacing: -0.5px; }
.date-line { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }

.mode-toggle, .theme-select, .btn {
  background: var(--card-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-chip);
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 13px;
  padding: 8px 16px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px;
}
.mode-toggle:hover, .btn:hover { background: var(--active-bg); }
.btn-accent { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }
.btn-accent:hover { opacity: .9; background: var(--accent-color); }

/* ===== GRID & CARDS ===== */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 20px 22px;
}
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.card-title { font-family: var(--font-display); font-size: 18px; font-weight: 400; }
.card-link { font-size: 12px; color: var(--accent-color); text-decoration: none; font-weight: 500; }

/* Weer */
.weather { display: flex; align-items: center; gap: 16px; }
.weather-glyph { width: 54px; height: 54px; color: var(--accent-color); flex-shrink: 0; }
.temp { font-family: var(--font-display); font-size: 52px; font-weight: 300; line-height: 1; }
.weather-sub { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.weather-hours { display: flex; gap: 14px; margin-top: 16px; overflow-x: auto; }
.weather-hour { text-align: center; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.weather-hour .icon { width: 20px; height: 20px; color: var(--accent-color); display: block; margin: 4px auto; }
.weather-hour .h-temp { color: var(--text-primary); font-weight: 500; }

/* Taken */
.task-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-color); }
.task-row:last-child { border-bottom: none; }
.check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--border-color); flex-shrink: 0; cursor: pointer;
  transition: background .15s, border-color .15s;
  background: none; padding: 0;
}
.check.done { background: var(--accent-color); border-color: var(--accent-color); }
.task-label { font-size: 14px; flex: 1; }
.task-label.done { text-decoration: line-through; opacity: .4; }
.task-who { font-size: 11px; color: var(--text-muted); background: var(--chip-bg); border-radius: 10px; padding: 2px 8px; }
.stars { font-size: 12px; color: var(--accent-color); font-weight: 600; white-space: nowrap; }

/* Kalender */
.event-row { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border-color); }
.event-row:last-child { border-bottom: none; }
.event-time { font-size: 12px; font-weight: 600; color: var(--accent-color); min-width: 44px; padding-top: 2px; }
.event-title { font-size: 14px; }
.event-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* Weekmenu */
.menu-days { display: flex; flex-direction: column; gap: 0; }
.menu-row { display: flex; gap: 14px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.menu-row:last-child { border-bottom: none; }
.menu-day { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); min-width: 34px; }
.menu-dish { font-size: 14px; flex: 1; }
.menu-row.today .menu-day, .menu-row.today .menu-dish { color: var(--accent-color); font-weight: 500; }

/* Chips / boodschappen / recepten */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--chip-bg); border: 1px solid var(--border-color); border-radius: var(--radius-chip); padding: 6px 13px; font-size: 13px; color: var(--text-primary); }
.chip.accent { background: var(--accent-bg); border-color: var(--accent-color); color: var(--accent-color); font-weight: 500; }
.shop-note { font-size: 12px; color: var(--text-muted); margin-top: 12px; }

/* Gezinsbalk */
.family { display: flex; gap: 18px; flex-wrap: wrap; }
.member { display: flex; align-items: center; gap: 10px; }
.member .avatar { width: 30px; height: 30px; font-size: 12px; }
.member-meta { line-height: 1.25; }
.member-name { font-size: 13px; font-weight: 500; }
.member-stars { font-size: 11px; color: var(--accent-color); }

/* Generieke lijst-item (modules) */
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
.list-item:last-child { border-bottom: none; }
.list-item .li-title { font-size: 14px; flex: 1; }
.list-item .li-sub { font-size: 12px; color: var(--text-muted); }
.empty { color: var(--text-muted); font-size: 13px; padding: 12px 0; }

/* Recepten-tegels */
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.recipe-tile { border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--border-color); background: var(--card-bg); text-decoration: none; color: var(--text-primary); }
.recipe-tile .cover { height: 120px; background: var(--accent-bg); background-size: cover; background-position: center; }
.recipe-tile .rt-body { padding: 12px 14px; }
.recipe-tile .rt-title { font-family: var(--font-display); font-size: 15px; }
.recipe-tile .rt-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* Formulieren */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px;
  background: var(--card-bg); border: 1px solid var(--border-color);
  border-radius: 12px; color: var(--text-primary);
  font-family: var(--font-body); font-size: 14px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent-color); }
.form-error { color: #d9544f; font-size: 12px; margin-top: 5px; }
.form-status { color: var(--accent-color); font-size: 13px; margin-bottom: 14px; }

/* ===== AUTH-KETEN (gecentreerd, glass-kaart, entree-animatie <300ms) ===== */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 1; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--card-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color); border-radius: 22px;
  padding: 36px 34px;
  animation: auth-in .28s ease both;
}
@keyframes auth-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.auth-brand { font-family: var(--font-display); font-size: 30px; font-weight: 400; letter-spacing: -0.5px; margin-bottom: 4px; }
.auth-brand em { font-style: italic; color: var(--accent-color); }
.auth-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.auth-card .btn, .auth-card button[type=submit] { width: 100%; justify-content: center; margin-top: 6px; }
.auth-link { display: block; text-align: center; font-size: 13px; color: var(--accent-color); text-decoration: none; margin-top: 16px; }

/* Gezinsleden-tegels */
.member-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; margin-top: 8px; }
.member-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 8px; border-radius: 16px; border: 1px solid var(--border-color);
  background: var(--chip-bg); text-decoration: none; color: var(--text-primary);
  transition: background .15s, transform .12s;
}
.member-tile:hover { background: var(--active-bg); transform: translateY(-2px); }
.member-tile .avatar { width: 52px; height: 52px; font-size: 20px; }
.member-tile .mt-name { font-size: 13px; font-weight: 500; }

/* PIN-invoer */
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 20px 0; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-color); }
.pin-dot.filled { background: var(--accent-color); border-color: var(--accent-color); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-key {
  aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--border-color);
  background: var(--chip-bg); color: var(--text-primary);
  font-family: var(--font-display); font-size: 22px; cursor: pointer;
  transition: background .12s;
}
.pin-key:hover { background: var(--active-bg); }
.pin-key.blank { border: none; background: none; cursor: default; }

.demo-note { margin-top: 28px; font-size: 12px; color: var(--text-muted); text-align: center; }

/* ===== Filters / segmented / acties (Fase 1.4) ===== */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-tab {
  padding: 7px 15px; border-radius: var(--radius-chip); border: 1px solid var(--border-color);
  background: var(--card-bg); color: var(--text-muted); font-size: 13px; text-decoration: none; cursor: pointer;
}
.filter-tab.active { background: var(--accent-bg); border-color: var(--accent-color); color: var(--accent-color); font-weight: 500; }
.filters .search {
  flex: 1; min-width: 160px; max-width: 320px; padding: 8px 14px; border-radius: var(--radius-chip);
  border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-primary); font-family: var(--font-body); font-size: 13px;
}
.seg { display: inline-flex; border: 1px solid var(--border-color); border-radius: var(--radius-chip); overflow: hidden; }
.seg a { padding: 7px 12px; font-size: 13px; color: var(--text-muted); text-decoration: none; background: var(--card-bg); }
.seg a.active { background: var(--accent-color); color: #fff; }

.row-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 15px; padding: 4px 6px; border-radius: 8px;
}
.icon-btn:hover { color: var(--text-primary); background: var(--chip-bg); }
.icon-btn.danger:hover { color: #d9544f; }

.add-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.add-form input, .add-form select {
  padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border-color);
  background: var(--card-bg); color: var(--text-primary); font-family: var(--font-body); font-size: 13px;
}
.add-form input[type=text], .add-form input:not([type]) { flex: 1; min-width: 140px; }
details.add-panel { margin-bottom: 18px; }
details.add-panel > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-chip); border: 1px solid var(--border-color);
  background: var(--card-bg); color: var(--text-primary); font-size: 13px; width: fit-content;
}
details.add-panel > summary::-webkit-details-marker { display: none; }
details.add-panel[open] > summary { background: var(--active-bg); }
details.add-panel .add-form { margin-top: 14px; }
.fav { color: #e0684a; }
.fav-off { color: var(--text-muted); }

/* ===== Kalender (macOS-opbouw) ===== */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 14px; }
.cal-nav .cal-title { font-family: var(--font-display); font-size: 18px; font-weight: 500; }
.cal-nav a { color: var(--text-muted); text-decoration: none; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.cal-nav a:hover { color: var(--text-primary); }

.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 4px; }
.cal-daycol {
  text-align: center; padding: 10px 0 12px; border-radius: 12px; text-decoration: none;
  color: var(--text-primary); border: 1px solid transparent;
}
.cal-daycol:hover { background: var(--chip-bg); }
.cal-daycol .dow { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.cal-daycol .dnum { font-family: var(--font-display); font-size: 22px; font-weight: 300; margin-top: 4px; }
.cal-daycol.sel { background: var(--accent-color); }
.cal-daycol.sel .dow, .cal-daycol.sel .dnum { color: #fff; }
.cal-daycol.today .dnum { color: var(--accent-color); }
.cal-daycol.sel.today .dnum { color: #fff; }
.cal-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-color); margin: 5px auto 0; }
.cal-daycol.sel .cal-dot { background: #fff; }

.cal-weekhead { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-weekhead div { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; padding-left: 4px; }
.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  min-height: 92px; border: 1px solid var(--border-color); border-radius: 10px;
  padding: 6px 8px; text-decoration: none; color: var(--text-primary); display: block;
  background: var(--card-bg);
}
.cal-cell:hover { background: var(--active-bg); }
.cal-cell.out { opacity: .4; }
.cal-cell.sel { border-color: var(--accent-color); }
.cal-cell .cnum { font-size: 13px; font-weight: 500; }
.cal-cell.today .cnum { color: var(--accent-color); font-weight: 700; }
.cal-cell .ev { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.cal-cell .ev::before { content: '•'; color: var(--accent-color); margin-right: 3px; }

.cal-section { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); margin: 16px 0 6px; }
.weekmenu-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--card-bg); margin-bottom: 8px; font-size: 13px; flex-wrap: wrap; }
.weekmenu-bar .wm-day { color: var(--text-muted); }

.detail-panel { margin-top: 4px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.detail-title { font-family: var(--font-display); font-size: 18px; font-weight: 500; }
.detail-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 6px; }
.attendee { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.attendee .resp { font-size: 12px; }
.resp-accepted { color: #4a9d5b; }
.resp-pending { color: var(--text-muted); }
.resp-declined { color: #c0392b; }
.ev-clickable { cursor: pointer; }
.ev-bar { border-left: 3px solid var(--accent-color); padding-left: 12px; }

/* ===== Taken-weergaven (macOS) ===== */
.weergave-seg { display: inline-flex; gap: 2px; }
.weergave-seg a { padding: 7px 10px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-muted); text-decoration: none; }
.weergave-seg a:first-child { border-radius: 10px 0 0 10px; }
.weergave-seg a:last-child { border-radius: 0 10px 10px 0; }
.weergave-seg a.active { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }

.taak-kolommen { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.taak-kolom-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px 12px 0 0; border: 1px solid var(--border-color); border-bottom: none; background: var(--card-bg); }
.taak-kolom-head .naam { flex: 1; font-weight: 600; font-size: 14px; }
.taak-kolom-head .telling { font-size: 12px; color: var(--text-muted); }
.taak-kolom-body { border: 1px solid var(--border-color); border-radius: 0 0 12px 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 40px; background: color-mix(in srgb, var(--card-bg) 60%, transparent); }
.taak-kaart { border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 12px; background: var(--card-bg); }
.taak-kaart .tk-top { display: flex; align-items: center; gap: 8px; }
.taak-kaart .tk-title { font-size: 13px; flex: 1; }
.taak-kaart .tk-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.taak-rooster { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }

/* ===== Modal (herbruikbaar: nieuwe taak) ===== */
.modal-toggle { display: none; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: flex-start; justify-content: center; padding: 60px 16px;
  background: rgba(0,0,0,.45); backdrop-filter: blur(3px); overflow-y: auto;
}
.modal-toggle:checked ~ .modal-overlay { display: flex; }
.modal-card {
  width: 100%; max-width: 520px;
  background: var(--theme-gradient);
  border: 1px solid var(--border-color); border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  animation: auth-in .22s ease both;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.modal-head .m-title { font-family: var(--font-display); font-size: 17px; }
.modal-head label, .modal-head button { cursor: pointer; background: none; border: none; color: var(--accent-color); font-size: 14px; font-family: var(--font-body); }
.modal-body { padding: 8px 20px 20px; max-height: 72vh; overflow-y: auto; }

/* Recept-formulier: deelgerechten + rich text */
.rf-sec { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.rf-sec .icon-btn { font-size: 15px; }
.rf-hint { font-size: 13px; color: var(--text-muted); background: var(--chip-bg); border-radius: 10px; padding: 10px 12px; }
.rf-subblock { border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.rf-subhead { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.rf-subhead .rs-name { flex: 1; padding: 8px 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg); color: var(--text-primary); font-weight: 500; font-family: var(--font-body); }
.rte-tools { display: flex; gap: 4px; margin-bottom: 6px; }
.rte-tools button { padding: 4px 10px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--card-bg); color: var(--text-primary); cursor: pointer; font-size: 13px; font-family: var(--font-body); }
.rte-tools button:hover { background: var(--active-bg); }
.rte { min-height: 120px; border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 12px; background: var(--card-bg); color: var(--text-primary); line-height: 1.6; }
.rte:focus { outline: none; border-color: var(--accent-color); }
.rte ul, .rte ol { margin-left: 20px; }

/* Gegroepeerde Basis-secties (macOS-stijl) */
.rf-groep { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 18px 0 6px; }
.fg { border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; background: var(--card-bg); }
.fg-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--border-color); }
.fg-row:last-child { border-bottom: none; }
.fg-lbl { width: 120px; flex-shrink: 0; font-size: 13px; color: var(--text-muted); }
.fg-row input, .fg-row select { flex: 1; background: none; border: none; color: var(--text-primary); font-family: var(--font-body); font-size: 14px; text-align: right; }
.fg-row input:focus, .fg-row select:focus { outline: none; }
.fg-row select { text-align-last: right; }
.fg-photo { text-align: center; margin: 4px 0 8px; }
.photo-box { display: inline-block; width: 150px; height: 110px; border-radius: 12px; border: 1px dashed var(--border-color);
  background: var(--chip-bg) center/cover no-repeat; cursor: pointer; position: relative; }
.photo-hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 12px; color: var(--text-primary);
  background: rgba(255,255,255,.6); padding: 3px 0; }
:root[data-theme] .photo-box { vertical-align: middle; }
.modal-sec { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 16px 0 8px; }
.modal-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.modal-row label.lbl { width: 110px; color: var(--text-muted); font-size: 13px; }
.modal-row input[type=text], .modal-row input[type=datetime-local], .modal-row select {
  flex: 1; background: none; border: none; color: var(--text-primary); font-family: var(--font-body); font-size: 14px; text-align: right;
}
.modal-row input:focus, .modal-row select:focus { outline: none; }
.modal-row input[type=range] { flex: 1; accent-color: var(--accent-color); }
.reward-val { min-width: 54px; text-align: right; font-weight: 600; color: var(--accent-color); }
.fab { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-color); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; border: none; text-decoration: none; }
.fab:hover { opacity: .9; }

/* ===== Beloningen (kaartenraster, macOS) ===== */
.score-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.score-card { border: 1px solid var(--border-color); border-radius: 14px; padding: 18px; text-align: center; background: var(--card-bg); }
.score-card.top { border-color: var(--accent-color); }
.score-card .medal { font-size: 18px; height: 22px; }
.score-card .rank { font-size: 12px; color: var(--text-muted); height: 22px; }
.score-card .avatar { width: 52px; height: 52px; font-size: 20px; margin: 8px auto 10px; }
.score-card .sc-name { font-size: 14px; font-weight: 500; }
.score-card .sc-stars { font-size: 14px; color: var(--accent-color); font-weight: 600; margin-top: 6px; }

.prize-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.prize-card { border: 1px solid var(--border-color); border-radius: 14px; padding: 20px 18px; text-align: center; background: var(--card-bg); }
.prize-card .p-icon { font-size: 30px; height: 40px; }
.prize-card .p-name { font-family: var(--font-display); font-size: 16px; margin-top: 6px; }
.prize-card .p-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; min-height: 30px; }
.prize-card .p-cost { font-size: 16px; font-weight: 600; color: var(--accent-color); margin: 10px 0; }
.prize-card button, .prize-card .p-btn { width: 100%; justify-content: center; }
.prize-card .p-btn.disabled { opacity: .45; pointer-events: none; }

/* ===== Recepten (macOS-tegels) ===== */
.recipe-tile { position: relative; }
.recipe-tile .cover { position: relative; }
.cover-link { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.rt-heart {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.4); border: none; color: #fff; cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.rt-heart.on { color: #ff5a5a; }
.rt-rating { color: #f0a020; font-size: 12px; letter-spacing: 1px; }
.rt-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; }
.rt-diff { font-size: 12px; font-weight: 500; }
.rt-diff.easy { color: #4a9d5b; }
.rt-diff.medium { color: #d99a1c; }
.rt-diff.hard { color: #d9544f; }
.rt-time { color: var(--text-muted); font-size: 12px; }
.filters select.mini {
  padding: 8px 12px; border-radius: var(--radius-chip); border: 1px solid var(--border-color);
  background: var(--card-bg); color: var(--text-primary); font-family: var(--font-body); font-size: 13px;
}

/* ===== Recept-modal (macOS detail + nieuw) ===== */
.modal-overlay.show { display: flex; }
.modal-wide { max-width: 900px; }
.rmodal-cover { height: 240px; background: var(--accent-bg) center/cover no-repeat; position: relative; }
.rmodal-bar { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border-color); }
.rmodal-bar .rb-spacer { flex: 1; }
.rmodal-rating { color: #f0a020; font-size: 16px; letter-spacing: 1px; }
.servings-step { display: inline-flex; align-items: center; gap: 12px; }
.servings-step a { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-color); display: inline-flex; align-items: center; justify-content: center; color: var(--accent-color); text-decoration: none; font-size: 16px; }
.servings-step .sv { min-width: 44px; text-align: center; font-weight: 600; }
.rtabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--border-color); }
.rtab { padding: 10px 14px; font-size: 13px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; font-family: var(--font-body); }
.rtab.active { color: var(--accent-color); border-bottom-color: var(--accent-color); font-weight: 500; }
.rcols { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; padding: 18px 20px;
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.ber-list { margin: 0; padding-left: 18px; }
.ber-list li { margin: 5px 0; line-height: 1.55; }
.rmeta { padding: 6px 20px 20px; border-top: 1px solid var(--border-color); font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.rmeta-blok { margin-top: 12px; font-size: 13px; }
.rmeta-blok a { color: var(--accent-color); word-break: break-all; text-decoration: none; }
.rmeta-blok a:hover { text-decoration: underline; }
.rcol-head { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.rgroep { color: var(--accent-color); font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.ring { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.ring .q { color: var(--text-primary); }

/* Filter-popovers (categorie/niveau/sterren) */
.filterpop { position: relative; }
.filterpop > summary { list-style: none; }
.filterpop > summary::-webkit-details-marker { display: none; }
.filter-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-chip); background: var(--card-bg); color: var(--text-primary); font-size: 13px; text-decoration: none; cursor: pointer; }
.filter-btn.active { background: var(--accent-bg); border-color: var(--accent-color); color: var(--accent-color); }
.filter-btn .icon { width: 16px; height: 16px; }
.filter-btn .caret { width: 11px; height: 11px; opacity: .55; }
.pop-menu { position: absolute; top: 42px; left: 0; z-index: 20; background: var(--theme-gradient); border: 1px solid var(--border-color); border-radius: 12px; padding: 6px; min-width: 210px; max-height: 380px; overflow: auto; box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.pop-menu a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 13px; color: var(--text-primary); text-decoration: none; white-space: nowrap; }
.pop-menu a:hover { background: var(--active-bg); }
.pop-menu a.sel { color: var(--accent-color); font-weight: 500; }
/* Ronde close-knop in modal-head */
.modal-head .icon-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--chip-bg); display: inline-flex; align-items: center; justify-content: center; }
.modal-head .icon-btn:hover { background: var(--active-bg); }

/* Lijst met thumbnails */
.thumb-row { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--border-color); text-decoration: none; color: var(--text-primary); }
.thumb-row:last-child { border-bottom: none; }
.thumb-row:hover { background: var(--chip-bg); }
.thumb-img { width: 64px; height: 64px; border-radius: 10px; background: var(--accent-bg) center/cover no-repeat; flex-shrink: 0; }
.thumb-body { flex: 1; }
.thumb-chevron { color: var(--text-muted); width: 16px; height: 16px; }

/* Klikbare sterren (detail) */
.star-rate { display: inline-flex; gap: 2px; }
.star-rate button { background: none; border: none; cursor: pointer; font-size: 18px; color: var(--border-color); padding: 0 1px; line-height: 1; }
.star-rate button.on { color: #f0a020; }
.star-rate button:hover { color: #f0a020; }

/* Niveau-pill + tijd-badge */
.diff-pill { font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 999px; }
.diff-pill.easy { background: rgba(74,157,91,.15); color: #4a9d5b; }
.diff-pill.medium { background: rgba(217,154,28,.15); color: #d99a1c; }
.diff-pill.hard { background: rgba(217,84,79,.15); color: #d9544f; }
.tijd-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text-primary); }
.tijd-badge .icon { width: 16px; height: 16px; color: var(--accent-color); }
.ring .q { color: var(--text-primary); }
.dots { position: relative; }
.dots > summary { list-style: none; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; background: var(--chip-bg); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.dots > summary::-webkit-details-marker { display: none; }
.dots-menu { position: absolute; right: 0; top: 40px; z-index: 5; background: var(--sidebar-bg); backdrop-filter: blur(20px); border: 1px solid var(--border-color); border-radius: 12px; padding: 6px; min-width: 210px; }
.dots-menu a, .dots-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--text-primary); text-decoration: none; font-size: 13px; background: none; border: none; cursor: pointer; font-family: var(--font-body); text-align: left; }
.dots-menu a:hover, .dots-menu button:hover { background: var(--active-bg); }
.mtabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--border-color); }
@media (max-width: 700px) { .rcols { grid-template-columns: 1fr; } }
@media print { .sidebar, .topbar, .modal-head, .rmodal-cover, .dots, .rtabs { display: none !important; } .modal-overlay { position: static; background: none; padding: 0; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 980px) {
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .main { padding: 26px 20px 90px; }
  .greeting { font-size: 27px; }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0;
    width: 100%; height: auto; flex-direction: row; align-items: center;
    padding: 8px 10px; border-right: none; border-top: 1px solid var(--border-color);
    overflow-x: auto; z-index: 10;
  }
  .brand, .nav-section, .sidebar-footer { display: none; }
  .nav-item { flex-direction: column; gap: 3px; font-size: 10px; padding: 6px 10px; margin: 0; flex-shrink: 0; }
  .nav-item .badge { display: none; }
  .layout { flex-direction: column; }
}

/* ── Weekmenu matrix ─────────────────────────────────────── */
.wm-nav { display: flex; gap: 8px; margin-bottom: 16px; }
.wm-navbtn {
  font-size: 13px; padding: 6px 12px; border: 1px solid var(--border-color);
  border-radius: var(--radius-chip, 8px); color: var(--accent-color);
  text-decoration: none; background: var(--card-bg);
}
.wm-navbtn:hover { border-color: var(--accent-color); }
.wm-scroll { overflow-x: auto; }
.wm-grid { border-collapse: collapse; width: 100%; min-width: 820px; }
.wm-grid th, .wm-grid td { border-bottom: 1px solid var(--border-color); vertical-align: top; }
.wm-grid thead th { text-align: center; padding: 10px 6px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.wm-dabbr { display: block; }
.wm-dnum { display: block; font-size: 17px; color: var(--text-primary); font-weight: 600; margin-top: 2px; }
.wm-today .wm-dabbr, .wm-today .wm-dnum { color: var(--accent-color); }
.wm-corner { width: 118px; }
.wm-slot { width: 118px; padding: 12px 14px; }
.wm-slotname { display: block; font-weight: 650; font-size: 13px; }
.wm-slottime { display: block; color: var(--text-muted); font-size: 11px; margin-top: 1px; }
.wm-cell { padding: 8px; min-width: 100px; }
.wm-chip {
  position: relative; border: 1px solid color-mix(in srgb, var(--c, var(--accent-color)) 35%, transparent);
  background: color-mix(in srgb, var(--c, var(--accent-color)) 8%, transparent);
  border-radius: var(--radius-chip, 9px); padding: 6px; margin-bottom: 6px;
}
.wm-chip-link { display: block; text-decoration: none; color: var(--text-primary); }
.wm-chip-photo { display: block; height: 38px; border-radius: 6px; background-size: cover; background-position: center; margin-bottom: 5px; }
.wm-chip-name { display: block; font-size: 11px; font-weight: 550; line-height: 1.25; }
.wm-badge {
  display: inline-block; margin-top: 4px; font-size: 9.5px; font-weight: 700;
  color: var(--accent-color); background: var(--accent-bg); border-radius: 999px; padding: 1px 6px;
}
.wm-free { background: var(--chip-bg); border-color: var(--border-color); }
.wm-free .wm-chip-name { font-weight: 600; }
.wm-del { position: absolute; top: 2px; right: 2px; margin: 0; }
.wm-del button { border: none; background: transparent; color: #b23; font-size: 14px; line-height: 1; cursor: pointer; opacity: .55; }
.wm-chip:hover .wm-del button { opacity: 1; }
.wm-add { margin-top: 2px; }
.wm-add > summary {
  list-style: none; cursor: pointer; text-align: center; height: 22px; line-height: 22px;
  border: 1px dashed var(--border-color); border-radius: 6px; color: var(--text-muted); font-size: 14px;
}
.wm-add > summary::-webkit-details-marker { display: none; }
.wm-add[open] > summary { color: var(--accent-color); border-color: var(--accent-color); }
.wm-addform { display: flex; flex-direction: column; gap: 6px; padding: 8px 4px 4px; }
.wm-addform select, .wm-addform input[type=text], .wm-addform input[type=number] {
  font-size: 12px; padding: 5px 7px; border: 1px solid var(--border-color);
  border-radius: 6px; background: var(--card-bg); color: var(--text-primary);
}
.wm-portie { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.wm-portie input { width: 64px; }
.wm-save { font-size: 12px; font-weight: 600; padding: 5px; border: none; border-radius: 6px; background: var(--accent-color); color: #fff; cursor: pointer; }

/* ── Weekmenu overlay recept-kiezer ──────────────────────── */
.wm-addbtn {
  display: block; width: 100%; text-align: center; height: 24px; line-height: 22px;
  border: 1px dashed var(--border-color); border-radius: 6px; background: transparent;
  color: var(--text-muted); font-size: 15px; cursor: pointer; margin-top: 2px;
}
.wm-addbtn:hover { color: var(--accent-color); border-color: var(--accent-color); }

.wm-modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: flex-start; justify-content: center; padding: 48px 16px;
  background: rgba(0,0,0,.45); backdrop-filter: blur(3px); overflow-y: auto;
}
.wm-modal.open { display: flex; }
.wm-modal-card {
  width: 100%; max-width: 560px; background: var(--theme-gradient);
  border: 1px solid var(--border-color); border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.wm-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border-color); }
.wm-modal-head .m-title { font-family: var(--font-display); font-size: 17px; }
.wm-modal-head button { cursor: pointer; background: none; border: none; color: var(--accent-color); font-size: 14px; font-family: var(--font-body); }
.wm-modal-body { padding: 14px 20px 18px; }

.wm-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.wm-tabs button {
  flex: 1; padding: 8px; border: 1px solid var(--border-color); border-radius: 8px;
  background: var(--card-bg); color: var(--text-muted); font-size: 13px; cursor: pointer; font-family: var(--font-body);
}
.wm-tabs button.active { color: #fff; background: var(--accent-color); border-color: var(--accent-color); }

.wm-search {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-color); border-radius: 9px;
  background: var(--card-bg); color: var(--text-primary); font-size: 14px; font-family: var(--font-body);
}
.wm-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.wm-filters select {
  flex: 1; min-width: 120px; padding: 7px 9px; border: 1px solid var(--border-color); border-radius: 8px;
  background: var(--card-bg); color: var(--text-primary); font-size: 12px; font-family: var(--font-body);
}
.wm-favchk { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.wm-results { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; margin-top: 4px; }
.wm-res {
  display: flex; align-items: center; gap: 12px; padding: 8px; width: 100%; text-align: left;
  border: 1px solid transparent; border-radius: 10px; background: var(--card-bg); cursor: pointer; font-family: var(--font-body);
}
.wm-res:hover { border-color: var(--border-color); }
.wm-res.sel { border-color: var(--accent-color); background: var(--active-bg); }
.wm-res-photo { width: 44px; height: 44px; flex-shrink: 0; border-radius: 8px; background-size: cover; background-position: center; background-color: var(--chip-bg); }
.wm-res-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wm-res-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.wm-res-meta { font-size: 11px; color: var(--text-muted); }
.wm-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 13px; }
.wm-morebtn { width: 100%; margin-top: 8px; padding: 8px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--card-bg); color: var(--accent-color); cursor: pointer; font-size: 13px; font-family: var(--font-body); }

.wm-modal-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-color); }
.wm-modal-foot .wm-portie { margin-right: auto; }
.wm-modal-foot .wm-save { padding: 9px 18px; }
.wm-modal-foot .wm-save:disabled { opacity: .45; cursor: not-allowed; }
