/**
 * Modul: Dashboard
 * Zweck: Styles für das Dashboard - Begrüßung, Widget-Grid, alle Widget-Typen, FAB-Speed-Dial
 * Abhängigkeiten: tokens.css, layout.css
 */

/* --------------------------------------------------------
 * Modul-Akzent
 * -------------------------------------------------------- */
.dashboard {
  --module-accent: var(--module-dashboard);
}

/* --------------------------------------------------------
 * Dashboard-Layout
 * -------------------------------------------------------- */
.dashboard {
  padding: var(--space-4);
  padding-bottom: var(--space-16);
  max-width: var(--content-max-width);
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .dashboard {
    padding: var(--space-6) var(--space-8);
    padding-bottom: var(--space-12);
  }
}

@media (min-width: 1440px) {
  .dashboard {
    padding: var(--space-6) var(--space-10);
  }
}

.dashboard-hero {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

@media (min-width: 1024px) {
  .dashboard-hero {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    align-items: stretch;
  }
}

.dashboard-hero .widget-greeting {
  box-shadow: var(--glass-shadow-md);
  min-height: 100%;
}

.dashboard-hero__rail {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 767px) {
  .dashboard-hero__rail {
    grid-template-columns: 1fr;
  }
}

.dashboard-metric {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 96px;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  border: 1px solid var(--glass-border-subtle);
  box-shadow: var(--glass-shadow-sm);
  text-align: left;
  appearance: none;
  color: inherit;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.dashboard-metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--glass-shadow-md);
}

.dashboard-metric__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-accent) 16%, transparent);
  color: var(--color-accent);
  flex-shrink: 0;
}

.dashboard-metric--warn .dashboard-metric__icon {
  background: color-mix(in srgb, var(--color-warning) 18%, transparent);
  color: var(--color-warning);
}

.dashboard-metric--calendar .dashboard-metric__icon {
  background: color-mix(in srgb, var(--module-calendar) 18%, transparent);
  color: var(--module-calendar);
}

.dashboard-metric--meals .dashboard-metric__icon {
  background: color-mix(in srgb, var(--module-meals) 18%, transparent);
  color: var(--module-meals);
}

.dashboard-metric--weather .dashboard-metric__icon {
  background: color-mix(in srgb, var(--module-dashboard) 18%, transparent);
  color: var(--module-dashboard);
}

.dashboard-metric__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dashboard-metric__title {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.dashboard-metric__value {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-metric__hint {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.dashboard-metric--skeleton {
  cursor: default;
}

/* --------------------------------------------------------
 * Widget-Grid
 *
 * Mobile:  1 Spalte
 * Tablet:  2 Spalten
 * Desktop: 3 Spalten
 * Wide:    4 Spalten (ab 1440px)
 * -------------------------------------------------------- */
.dashboard__grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

/* Widgets füllen die gesamte Gridzeilen-Höhe, so dass alle Widgets
 * einer Zeile gleich hoch sind und keine Lücken entstehen. */
.widget-wrapper {
  display: flex;
  flex-direction: column;
}

.widget-wrapper > .widget {
  flex: 1;
}

@media (min-width: 768px) {
  .dashboard__grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 1024px) {
  .dashboard__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
  }

  .widget--wide {
    grid-column: span 2;
  }
}

@media (min-width: 1280px) {
  .dashboard__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Wide-Widgets nehmen 2 von 4 Spalten ein */
  .widget--wide {
    grid-column: span 2;
  }

  /* Greeting-Widget über alle 4 Spalten */
  .widget-greeting {
    grid-column: 1 / -1;
  }
}

/* --------------------------------------------------------
 * Begrüßungs-Widget
 * -------------------------------------------------------- */
.widget-greeting {
  --greeting-from: var(--color-accent-active);
  --greeting-to: var(--color-accent);
  background: linear-gradient(135deg, var(--greeting-from), var(--greeting-to));
  transition: background var(--transition-slow);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  color: var(--color-text-on-accent);
  grid-column: 1 / -1;
}

/* Tageszeit-Varianten */
.widget-greeting[data-time-variant="morning"] {
  --greeting-from: var(--greeting-morning-from);
  --greeting-to:   var(--greeting-morning-to);
}
.widget-greeting[data-time-variant="evening"] {
  --greeting-from: var(--greeting-evening-from);
  --greeting-to:   var(--greeting-evening-to);
}

.widget-greeting__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.widget-greeting__content {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.widget-greeting__title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
}

@media (min-width: 1024px) {
  .widget-greeting__title {
    font-size: var(--text-xl);
    opacity: 0.85;
    white-space: nowrap;
    padding-top: 4px;
  }
}

.widget-greeting__date {
  font-size: var(--text-sm);
  opacity: 0.85;
}

.widget-greeting__chips {
  display: flex;
  flex-wrap: wrap;
  margin-top: 4px;
  align-items: center;
  gap: var(--space-2, 8px);
}

.greeting-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-glass);
  color: var(--color-text-on-accent);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  padding: var(--space-0h) var(--space-2);
  border-radius: var(--radius-full);
}

.greeting-chip--warn {
  background: var(--color-danger-translucent);
}

.greeting-chip--due {
  background: var(--color-warning-translucent);
}

/* --------------------------------------------------------
 * Widget-Modul-Akzentfarben
 * Jedes Widget nutzt seine eigene Modulfarbe für Icon, Badge und Link.
 * -------------------------------------------------------- */
.widget--tasks    { --widget-accent: var(--module-tasks); }
.widget--calendar { --widget-accent: var(--module-calendar); }
.widget--shopping { --widget-accent: var(--module-shopping); }
.widget--meals    { --widget-accent: var(--module-meals); }
.widget--notes    { --widget-accent: var(--module-notes); }
.widget--budget   { --widget-accent: var(--module-budget); }
.widget--contacts { --widget-accent: var(--module-contacts); }
.widget--weather  { --widget-accent: var(--module-dashboard); }
.widget--birthdays { --widget-accent: var(--module-birthdays); }
.widget--family   { --widget-accent: var(--module-contacts); }

/* --------------------------------------------------------
 * Basis-Widget (Card)
 *
 * Kompaktes Padding: 12px Header, 12px Body.
 * Internes Spacing: 8–12px (enger als vorher 16–24px).
 * -------------------------------------------------------- */
.widget {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow-sm);
  border: 1px solid var(--glass-border-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--glass-highlight-subtle);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  pointer-events: none;
  z-index: 1;
}

.widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4) var(--space-2);
  position: relative;
  z-index: 2;
}

.widget__title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.widget__title-icon {
  width: 16px;
  height: 16px;
  color: var(--color-text-secondary);
}

.widget__link {
  font-size: var(--text-xs);
  color: var(--widget-accent, var(--color-accent));
  font-weight: var(--font-weight-medium);
  display: inline-flex;
  align-items: center;
  gap: var(--space-0h);
  transition: opacity var(--transition-fast), background-color var(--transition-fast);
  min-height: var(--target-base);
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  margin-right: calc(-1 * var(--space-2));
}

.widget__link:hover {
  opacity: 1;
  background-color: color-mix(in srgb, var(--widget-accent, var(--color-accent)) 10%, transparent);
}

.widget__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--widget-accent, var(--color-accent));
  color: var(--color-text-on-accent);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  line-height: 1;
}

.widget__body {
  flex: 1;
  padding: var(--space-2) var(--space-4) var(--space-4);
}

.widget__empty {
  padding: var(--space-3) var(--space-4);
  color: var(--color-text-tertiary);
  font-size: var(--text-sm);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-2);
}

.widget__empty .empty-state__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-text-tertiary);
  opacity: 0.6;
}

/* Widget hover lift (desktop) */
@media (min-width: 1024px) {
  .widget {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  }
  .widget:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}

/* --------------------------------------------------------
 * Aufgaben-Widget
 * Kompakte Items: 8px vertikales Padding, enger Spacing.
 * -------------------------------------------------------- */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  cursor: pointer;
  touch-action: pan-y;
  transition: opacity var(--transition-fast);
}

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

.task-item:hover {
  opacity: 0.7;
}

.task-item__priority {
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  margin-top: var(--space-1);
}

.task-item__priority--urgent { background-color: var(--color-priority-urgent); }
.task-item__priority--high   { background-color: var(--color-priority-high); }
.task-item__priority--medium { background-color: var(--color-priority-medium); }
.task-item__priority--low    { background-color: var(--color-priority-low); }

.task-item__content {
  flex: 1;
  min-width: 0;
}

.task-item__title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: var(--line-height-snug);
}

.task-item__meta {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-top: 1px;
}

.task-item__meta--overdue {
  color: var(--color-danger);
  font-weight: var(--font-weight-medium);
}

.task-item__meta--soon {
  color: var(--color-soon);
  font-weight: var(--font-weight-medium);
}

.task-item__avatar {
  width: var(--space-5);
  height: var(--space-5);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-on-accent);
  flex-shrink: 0;
  margin-top: 1px;
}

/* --------------------------------------------------------
 * Termine-Widget
 * Kompakt: Farbbalken + Inhalt, enge Abstände.
 * -------------------------------------------------------- */
.event-item {
  display: flex;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  cursor: pointer;
  touch-action: pan-y;
  transition: opacity var(--transition-fast);
}

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

.event-item:hover {
  opacity: 0.7;
}

.event-item__bar {
  width: 3px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  background-color: var(--color-accent);
  filter: saturate(0.4);
}

.event-item__content {
  flex: 1;
  min-width: 0;
}

.event-item__title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: var(--line-height-snug);
}

.event-item__time {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-top: 1px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.event-item__cal {
  width: 100%;
  font-size: var(--text-xs);
  color: var(--color-text-disabled);
}

.event-time-badge {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  padding: var(--space-px) var(--space-1);
  border-radius: var(--radius-full);
  background-color: var(--color-surface-3);
  color: var(--color-text-secondary);
}

.event-time-badge--today {
  background-color: var(--color-accent-light);
  color: var(--color-accent);
}

/* --------------------------------------------------------
 * Essen-Widget (Slot-Grid)
 * -------------------------------------------------------- */
.widget--meals {
  overflow: visible;
}

.meal-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-px);
  background-color: var(--color-border);
}

.meal-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-2) var(--space-1);
  background-color: var(--color-surface);
  cursor: pointer;
  touch-action: pan-y;
  transition: background-color var(--transition-fast);
  text-align: center;
  min-height: 72px;
}

.meal-slot:hover {
  background-color: var(--color-surface-2);
}

.meal-slot:first-child {
  border-bottom-left-radius: var(--radius-md);
}

.meal-slot:last-child {
  border-bottom-right-radius: var(--radius-md);
}

/* Meal-Typ-Farben aus tokens.css */
.meal-slot[data-type="breakfast"] { --slot-color: var(--meal-breakfast); }
.meal-slot[data-type="lunch"]     { --slot-color: var(--meal-lunch); }
.meal-slot[data-type="dinner"]    { --slot-color: var(--meal-dinner); }
.meal-slot[data-type="snack"]     { --slot-color: var(--meal-snack); }

.meal-slot__icon {
  width: 18px;
  height: 18px;
  color: var(--color-text-disabled);
  flex-shrink: 0;
}

.meal-slot--filled .meal-slot__icon {
  color: var(--slot-color, var(--color-accent));
}

.meal-slot__type {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-disabled);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.meal-slot--filled .meal-slot__type {
  color: var(--slot-color, var(--color-text-secondary));
}

.meal-slot__title {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  padding: 0 var(--space-1);
}

.meal-slot--filled .meal-slot__title {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

/* Desktop: 2x2 Grid statt 4x1 für mehr Breite pro Slot */
@media (min-width: 1024px) {
  .meal-slots {
    grid-template-columns: repeat(2, 1fr);
  }

  .meal-slot:first-child {
    border-bottom-left-radius: 0;
  }

  .meal-slot:last-child {
    border-bottom-right-radius: 0;
  }

  .meal-slot:nth-child(3) {
    border-bottom-left-radius: var(--radius-md);
  }

  .meal-slot:nth-child(4) {
    border-bottom-right-radius: var(--radius-md);
  }
}

/* --------------------------------------------------------
 * Shopping-Widget
 * -------------------------------------------------------- */
.shopping-widget-list {
  cursor: pointer;
  touch-action: pan-y;
  transition: background-color var(--transition-fast);
  border-radius: var(--radius-sm);
  padding: var(--space-2) 0;
}

.shopping-widget-list:hover {
  background-color: var(--color-surface-2);
}

.shopping-widget-list + .shopping-widget-list {
  border-top: 1px solid var(--color-border-subtle);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
}

.shopping-widget-list__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-1);
}

.shopping-widget-list__name {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.shopping-widget-list__count {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
}

.shopping-widget-list__progress {
  height: 6px;
  background-color: var(--color-surface-3);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.shopping-widget-list__bar {
  height: 100%;
  background-color: var(--color-success);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.shopping-widget-list__items {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.shopping-widget-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.shopping-widget-item__dot {
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background-color: var(--color-text-disabled);
  flex-shrink: 0;
}

.shopping-widget-item__name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shopping-widget-item__qty {
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.shopping-widget-item--more {
  color: var(--color-text-tertiary);
  font-style: italic;
}

/* --------------------------------------------------------
 * Notizen-Grid-Widget
 * -------------------------------------------------------- */
.notes-grid-widget {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

@media (min-width: 1024px) {
  .notes-grid-widget {
    grid-template-columns: repeat(3, 1fr);
  }
}

.note-item {
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  cursor: pointer;
  touch-action: pan-y;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  border-left: 3px solid var(--note-color, var(--color-accent));
  background-color: color-mix(in srgb, var(--note-color, var(--color-accent)) 6%, var(--color-surface-2));
}

.note-item:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.note-item__title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-item__content {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------
 * Wetter-Widget
 *
 * Eigener Gradient, überschreibt .widget Hintergrund.
 * Mobile: kompakt, 3-Tage-Vorhersage.
 * Desktop: volle Breite über allen Widgets, horizontales
 *          Layout mit bis zu 5-Tage-Vorhersage.
 * -------------------------------------------------------- */
.weather-widget {
  position: relative;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-deep) 100%);
  color: var(--color-text-on-accent);
}

.weather-widget__refresh {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--color-glass);
  color: var(--color-text-on-accent);
  border-radius: var(--radius-full);
  cursor: pointer;
  z-index: 1;
  transition: background var(--transition-fast);
}

.weather-widget__refresh:hover {
  background: var(--color-glass-hover);
}

.weather-widget__refresh:disabled {
  opacity: 0.5;
  cursor: default;
}

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

.weather-widget__refresh--spinning i {
  animation: spin 0.7s linear infinite;
}

.weather-widget__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
}

.weather-widget__temp {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  margin-bottom: 2px;
}

.weather-widget__desc {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  text-transform: capitalize;
  margin-bottom: 1px;
}

.weather-widget__city {
  font-size: var(--text-xs);
  opacity: 0.85;
  margin-bottom: var(--space-1);
}

.weather-widget__meta {
  font-size: var(--text-xs);
  opacity: 0.7;
  line-height: 1.3;
}

.weather-widget__icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  filter: var(--shadow-drop-icon);
}

.weather-forecast {
  display: flex;
  border-top: 1px solid var(--color-glass-border);
  padding: var(--space-2) var(--space-4);
  gap: var(--space-3);
}

.weather-forecast__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}

/* Tage 4+5 nur auf breiteren Bildschirmen sichtbar */
.weather-forecast__day--extended {
  display: none;
}

.weather-forecast__label {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  opacity: 0.85;
  text-transform: capitalize;
}

.weather-forecast__icon {
  width: 28px;
  height: 28px;
}

.weather-forecast__temps {
  display: flex;
  gap: var(--space-1);
  font-size: var(--text-xs);
}

.weather-forecast__high {
  font-weight: var(--font-weight-semibold);
}

.weather-forecast__low {
  opacity: 0.6;
}

/* Tablet: Wetter über volle Breite, 4 Tage */
@media (min-width: 768px) {
  .weather-widget {
    grid-column: 1 / -1;
  }

  .weather-widget__inner {
    display: flex;
    align-items: stretch;
  }

  .weather-widget__main {
    flex-shrink: 0;
  }

  .weather-forecast {
    border-top: none;
    border-left: 1px solid var(--color-glass-border);
    flex: 1;
    align-items: center;
    padding: var(--space-3) var(--space-4);
  }

  .weather-forecast__day--extended:nth-child(-n+4) {
    display: flex;
  }
}

/* Desktop: 5-Tage-Vorhersage, größere Elemente */
@media (min-width: 1024px) {
  .weather-widget {
    grid-column: 1 / -1;
  }

  .weather-widget__main {
    padding: var(--space-4) var(--space-5);
  }

  .weather-widget__temp {
    font-size: var(--text-4xl);
  }

  .weather-widget__icon {
    width: 80px;
    height: 80px;
  }

  .weather-forecast {
    gap: var(--space-4);
    padding: var(--space-3) var(--space-5);
  }

  .weather-forecast__day--extended {
    display: flex;
  }

  .weather-forecast__icon {
    width: 36px;
    height: 36px;
  }

  .weather-forecast__temps {
    font-size: var(--text-sm);
  }

  .weather-forecast__label {
    font-size: var(--text-sm);
  }
}

/* Wide Desktop: noch mehr Platz */
@media (min-width: 1440px) {
  .weather-widget {
    grid-column: 1 / -1;
  }

  .weather-widget__main {
    padding: var(--space-4) var(--space-6);
  }

  .weather-forecast {
    gap: var(--space-5);
    padding: var(--space-3) var(--space-6);
  }

  .weather-forecast__icon {
    width: 40px;
    height: 40px;
  }
}

/* --------------------------------------------------------
 * Skeleton-Zustände (pro Widget)
 * Kompakt: gleiches Spacing wie echte Widgets.
 * -------------------------------------------------------- */
.widget-skeleton {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-3) var(--space-4);
}

.skeleton-line {
  height: 12px;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-xs);
}

.skeleton-line--short  { width: 35%; }
.skeleton-line--medium { width: 60%; }
.skeleton-line--full   { width: 100%; }

/* --------------------------------------------------------
 * FAB Speed-Dial
 * -------------------------------------------------------- */
.fab-container {
  position: fixed;
  bottom: calc(var(--nav-bottom-height) + 24px + var(--safe-area-inset-bottom));
  right: calc(var(--space-4) * 2);
  z-index: calc(var(--z-nav) - 1);
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: var(--space-3);
}

@media (min-width: 1024px) {
  .fab-container {
    bottom: var(--space-8);
  }
}

.fab-main {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background-color: var(--module-accent, var(--color-accent));
  color: var(--color-text-on-accent);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color var(--transition-fast);
  border: none;
  flex-shrink: 0;
}

@media (min-width: 1024px) {
  .fab-main {
    width: 48px;
    height: 48px;
  }
}

.fab-main:hover {
  background-color: color-mix(in srgb, var(--module-accent, var(--color-accent)) 85%, black);
}

.fab-main:active {
  transform: scale(0.95);
}

.fab-main--open {
  transform: rotate(45deg);
  background-color: var(--neutral-600);
}

.fab-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-backdrop-fab);
  z-index: calc(var(--z-nav) - 10);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.fab-backdrop--visible {
  opacity: 1;
  pointer-events: auto;
}

.fab-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.fab-actions--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.fab-action {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.fab-action__label {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

.fab-action__btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
  color: var(--color-accent);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--transition-fast);
}

.fab-action__btn:hover {
  background-color: var(--color-accent-light);
}

/* --------------------------------------------------------
 * Widget-Customize-Button (im Greeting-Header)
 * -------------------------------------------------------- */
.widget-customize-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-glass);
  border: 1px solid var(--color-glass-hover);
  color: var(--color-text-on-accent);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color var(--transition-fast);
}

.widget-customize-btn:hover,
.widget-customize-btn:focus-visible {
  background: var(--color-glass-hover);
  outline: 2px solid var(--glass-highlight-mid);
  outline-offset: 2px;
}

/* --------------------------------------------------------
 * Dashboard-Customize-Modal
 * -------------------------------------------------------- */
.customize-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.customize-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.customize-row:hover {
  background-color: var(--color-surface-hover);
}

.customize-row[draggable="true"] {
  cursor: grab;
}

.customize-row--dragging {
  opacity: 0.4;
}

.customize-row--over {
  background-color: var(--color-surface-3);
  outline: 1px dashed var(--color-border);
  outline-offset: -1px;
}

.customize-row__toggle {
  position: relative;
  display: inline-flex;
  cursor: pointer;
  flex-shrink: 0;
}

.customize-row__check {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.customize-row__slider {
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: var(--radius-full);
  background-color: var(--color-border);
  transition: background-color var(--transition-fast);
  position: relative;
}

.customize-row__slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.customize-row__check:checked + .customize-row__slider {
  background-color: var(--color-accent);
}

.customize-row__check:checked + .customize-row__slider::after {
  transform: translateX(16px);
}

.customize-row__check:focus-visible + .customize-row__slider {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.customize-row__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-secondary);
}

.customize-row__name {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
}

.customize-row__actions {
  display: flex;
  gap: var(--space-1);
  flex-shrink: 0;
}

.customize-row__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.customize-row__btn:hover:not(:disabled) {
  background-color: var(--color-surface-hover);
  color: var(--color-text-primary);
}

.customize-row__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Onboarding Overlay ── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: color-mix(in srgb, var(--color-bg) 70%, transparent);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  animation: onboarding-in 0.3s var(--ease-out);
}

.onboarding-overlay--out {
  animation: onboarding-out 0.25s ease forwards;
}

@keyframes onboarding-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes onboarding-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.onboarding-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.onboarding-icon {
  width: 48px;
  height: 48px;
  color: var(--color-accent);
}

.onboarding-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin: 0;
}

.onboarding-body {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.onboarding-dots {
  display: flex;
  gap: var(--space-2);
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background 0.2s;
}

.onboarding-dot--active {
  background: var(--color-accent);
}

.onboarding-actions {
  display: flex;
  gap: var(--space-3);
  width: 100%;
  justify-content: flex-end;
  margin-top: var(--space-2);
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-overlay,
  .onboarding-overlay--out { animation: none; }
  .onboarding-dot { transition: none; }
}

/* --------------------------------------------------------
 * Modern Dashboard Skin
 * -------------------------------------------------------- */
.dashboard {
  position: relative;
  isolation: isolate;
  overflow: clip;
}

.dashboard::before,
.dashboard::after {
  content: '';
  position: absolute;
  inset: auto;
  z-index: -1;
  pointer-events: none;
  filter: blur(28px);
  opacity: 0.55;
}

.dashboard::before {
  top: -80px;
  right: -120px;
  width: min(42vw, 520px);
  height: min(42vw, 520px);
  background: radial-gradient(circle, color-mix(in srgb, var(--module-dashboard) 22%, transparent) 0%, transparent 70%);
}

.dashboard::after {
  left: -140px;
  bottom: 8%;
  width: min(36vw, 440px);
  height: min(36vw, 440px);
  background: radial-gradient(circle, color-mix(in srgb, var(--module-calendar) 18%, transparent) 0%, transparent 72%);
}

.dashboard-shell {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.dashboard-hero {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 1100px) {
  .dashboard-hero {
    grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.85fr);
  }
}

.dashboard-hero__panel {
  position: relative;
  overflow: hidden;
  border-radius: clamp(22px, 3vw, 34px);
  padding: clamp(1.25rem, 2vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--color-border) 30%, transparent);
  box-shadow: 0 18px 60px color-mix(in srgb, var(--color-shadow) 22%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.dashboard-hero__panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--module-dashboard) 20%, transparent), transparent 42%),
    radial-gradient(circle at bottom left, color-mix(in srgb, var(--module-calendar) 14%, transparent), transparent 38%);
  opacity: 0.9;
  pointer-events: none;
}

.dashboard-hero__panel > * {
  position: relative;
  z-index: 1;
}

.dashboard-hero__panel--intro {
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--module-dashboard) 20%, var(--color-surface)) 0%,
      color-mix(in srgb, var(--module-calendar) 10%, var(--color-surface)) 48%,
      color-mix(in srgb, var(--module-shopping) 8%, var(--color-surface)) 100%);
}

.dashboard-hero__panel--summary {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--color-surface) 90%, transparent) 0%,
      color-mix(in srgb, var(--color-surface-2) 78%, transparent) 100%);
}

.dashboard-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-hero__title {
  margin: var(--space-3) 0 0;
  font-size: clamp(2.1rem, 4.5vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: var(--font-weight-bold);
  max-width: 14ch;
}

.dashboard-hero__subtitle {
  margin: var(--space-3) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--text-base);
}

.dashboard-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.dashboard-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-text-primary) 7%, transparent);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
}

.dashboard-chip--danger {
  background: color-mix(in srgb, var(--color-danger) 16%, transparent);
  color: var(--color-danger);
}

.dashboard-chip--warning {
  background: color-mix(in srgb, var(--color-warning) 18%, transparent);
  color: var(--color-warning);
}

.dashboard-chip--accent {
  background: color-mix(in srgb, var(--module-dashboard) 16%, transparent);
  color: var(--module-dashboard);
}

.dashboard-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.dashboard-action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid color-mix(in srgb, var(--color-border) 40%, transparent);
  background: color-mix(in srgb, var(--color-surface) 76%, transparent);
  color: var(--color-text-primary);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.dashboard-action:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: color-mix(in srgb, var(--color-accent) 30%, transparent);
}

.dashboard-action__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-accent);
  flex-shrink: 0;
}

.dashboard-action--blue .dashboard-action__icon {
  background: color-mix(in srgb, var(--module-tasks) 14%, transparent);
  color: var(--module-tasks);
}

.dashboard-action--violet .dashboard-action__icon {
  background: color-mix(in srgb, var(--module-calendar) 14%, transparent);
  color: var(--module-calendar);
}

.dashboard-action--green .dashboard-action__icon {
  background: color-mix(in srgb, var(--module-shopping) 14%, transparent);
  color: var(--module-shopping);
}

.dashboard-action--amber .dashboard-action__icon {
  background: color-mix(in srgb, var(--module-notes) 14%, transparent);
  color: var(--module-notes);
}

.dashboard-action__label {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
}

.dashboard-hero__summary-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-3);
}

.dashboard-hero__summary-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
}

.dashboard-hero__summary-value {
  margin-top: var(--space-1);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

.dashboard-hero__summary-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
  margin-top: var(--space-4);
}

@media (min-width: 680px) {
  .dashboard-hero__summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dashboard-stat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 88px;
  padding: var(--space-3);
  border-radius: 24px;
  background: color-mix(in srgb, var(--color-surface) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-border) 42%, transparent);
  box-shadow: var(--shadow-xs);
}

.dashboard-stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  color: var(--color-accent);
  flex-shrink: 0;
}

.dashboard-stat--danger .dashboard-stat__icon {
  background: color-mix(in srgb, var(--color-danger) 16%, transparent);
  color: var(--color-danger);
}

.dashboard-stat--calendar .dashboard-stat__icon {
  background: color-mix(in srgb, var(--module-calendar) 16%, transparent);
  color: var(--module-calendar);
}

.dashboard-stat--meals .dashboard-stat__icon {
  background: color-mix(in srgb, var(--module-meals) 16%, transparent);
  color: var(--module-meals);
}

.dashboard-stat--weather .dashboard-stat__icon {
  background: color-mix(in srgb, var(--module-dashboard) 16%, transparent);
  color: var(--module-dashboard);
}

.dashboard-stat__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dashboard-stat__title {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}

.dashboard-stat__value {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-stat--skeleton {
  min-height: 88px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--color-surface-2) 40%, transparent),
    color-mix(in srgb, var(--color-surface) 88%, transparent),
    color-mix(in srgb, var(--color-surface-2) 40%, transparent));
  background-size: 200% 100%;
  animation: dashboard-sheen 1.8s ease-in-out infinite;
}

.dashboard-layout {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 1100px) {
  .dashboard-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.92fr);
    align-items: start;
  }
}

.dashboard-layout__main,
.dashboard-layout__side {
  min-width: 0;
}

@media (min-width: 1100px) {
  .dashboard-layout__side {
    position: sticky;
    top: calc(var(--space-4) + 72px);
    align-self: start;
  }
}

.dashboard-layout__grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 780px) {
  .dashboard-layout__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dashboard-layout__stack {
  display: grid;
  gap: var(--space-4);
}

.dashboard-tile {
  min-width: 0;
}

.dashboard-tile--wide {
  grid-column: 1 / -1;
}

.dashboard .widget {
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--color-border) 42%, transparent);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--color-surface) 96%, transparent) 0%,
      color-mix(in srgb, var(--color-surface-2) 88%, transparent) 100%);
  box-shadow: 0 16px 48px color-mix(in srgb, var(--color-shadow) 18%, transparent);
}

.dashboard .widget::before {
  height: 4px;
  background: linear-gradient(90deg, var(--widget-accent, var(--color-accent)), transparent 78%);
  opacity: 1;
}

.dashboard .widget__header {
  padding: var(--space-4) var(--space-4) var(--space-2);
}

.dashboard .widget__body,
.dashboard .notes-grid-widget {
  padding: 0 var(--space-4) var(--space-4);
}

.dashboard .widget__empty {
  padding: 0 var(--space-4) var(--space-4);
}

.dashboard .task-item,
.dashboard .event-item,
.dashboard .meal-slot,
.dashboard .shopping-widget-list,
.dashboard .note-item {
  border-radius: 20px;
}

.dashboard .task-item:hover,
.dashboard .event-item:hover,
.dashboard .meal-slot:hover,
.dashboard .shopping-widget-list:hover,
.dashboard .note-item:hover {
  transform: translateY(-2px);
}

.dashboard .weather-widget {
  border-radius: 28px;
}

.dashboard .weather-widget__inner {
  padding: 0 var(--space-4) var(--space-4);
}

.dashboard .weather-widget__refresh {
  top: var(--space-3);
  right: var(--space-3);
}

@keyframes dashboard-sheen {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --------------------------------------------------------
 * Admin Dashboard Layout
 * -------------------------------------------------------- */
.dashboard {
  max-width: min(1680px, 100%);
  overflow: visible;
}

.dashboard::before,
.dashboard::after {
  display: none;
}

.dashboard-shell {
  gap: var(--space-5);
}

.dashboard-overview {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  border-top: 3px solid var(--module-accent);
  border-bottom: 1px solid var(--color-border);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--color-surface) 96%, transparent),
      color-mix(in srgb, var(--color-surface-2) 86%, transparent));
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 1024px) {
  .dashboard-overview {
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--module-accent);
    border-radius: 8px;
    padding: var(--space-5);
  }
}

.dashboard-overview__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 900px) {
  .dashboard-overview__header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.dashboard-overview__heading {
  min-width: 0;
}

.dashboard-overview__date {
  display: block;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
}

.dashboard-overview__title {
  margin: var(--space-1) 0 0;
  color: var(--color-text-primary);
  font-size: var(--text-2xl);
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: var(--font-weight-bold);
  overflow-wrap: anywhere;
}

.dashboard-overview__tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.dashboard-overview__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
  padding-bottom: 1px;
}

.dashboard-overview__actions::-webkit-scrollbar {
  display: none;
}

.dashboard-action {
  min-height: 36px;
  padding: 0 var(--space-2);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  box-shadow: none;
  flex: 0 0 auto;
}

.dashboard-action:hover {
  transform: none;
  box-shadow: var(--shadow-xs);
  border-color: color-mix(in srgb, var(--module-accent) 42%, var(--color-border));
}

.dashboard-action__icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.dashboard-action__icon svg {
  width: 15px;
  height: 15px;
}

.dashboard-action__label {
  font-size: var(--text-sm);
  white-space: nowrap;
}

.dashboard-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  flex: 0 0 auto;
  transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.dashboard-icon-btn:hover,
.dashboard-icon-btn:focus-visible {
  color: var(--color-text-primary);
  border-color: color-mix(in srgb, var(--module-accent) 42%, var(--color-border));
  background: var(--color-surface-hover);
}

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

.dashboard-kpi-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.dashboard-kpi {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  min-height: 92px;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-primary);
  text-align: left;
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.dashboard-kpi:hover {
  border-color: color-mix(in srgb, var(--module-accent) 36%, var(--color-border));
  background: var(--color-surface-hover);
}

.dashboard-kpi__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--module-accent) 14%, transparent);
  color: var(--module-accent);
}

.dashboard-kpi__icon svg {
  width: 19px;
  height: 19px;
}

.dashboard-kpi--danger .dashboard-kpi__icon {
  background: color-mix(in srgb, var(--color-danger) 14%, transparent);
  color: var(--color-danger);
}

.dashboard-kpi--calendar .dashboard-kpi__icon {
  background: color-mix(in srgb, var(--module-calendar) 14%, transparent);
  color: var(--module-calendar);
}

.dashboard-kpi--meals .dashboard-kpi__icon {
  background: color-mix(in srgb, var(--module-meals) 14%, transparent);
  color: var(--module-meals);
}

.dashboard-kpi--weather .dashboard-kpi__icon {
  background: color-mix(in srgb, var(--module-dashboard) 14%, transparent);
  color: var(--module-dashboard);
}

.dashboard-kpi--birthdays .dashboard-kpi__icon {
  background: color-mix(in srgb, var(--module-birthdays) 14%, transparent);
  color: var(--module-birthdays);
}

.dashboard-kpi--family .dashboard-kpi__icon {
  background: color-mix(in srgb, var(--module-contacts) 14%, transparent);
  color: var(--module-contacts);
}

.dashboard-kpi__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.dashboard-kpi__label {
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
}

.dashboard-kpi__value {
  color: var(--color-text-primary);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi__meta {
  color: var(--color-text-tertiary);
  font-size: var(--text-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-kpi--skeleton {
  min-height: 92px;
  background: linear-gradient(90deg, var(--color-surface-2), var(--color-surface), var(--color-surface-2));
  background-size: 200% 100%;
  animation: dashboard-sheen 1.6s ease-in-out infinite;
}

.dashboard-workspace {
  display: grid;
  gap: var(--space-4);
  align-items: start;
}

@media (min-width: 1180px) {
  .dashboard-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  }
}

.dashboard-workspace__main,
.dashboard-workspace__side {
  min-width: 0;
}

.dashboard-widget-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

@media (min-width: 820px) {
  .dashboard-widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dashboard-side-stack {
  display: grid;
  gap: var(--space-4);
  align-items: start;
}

.dashboard-tile {
  min-width: 0;
}

@media (min-width: 820px) {
  .dashboard-tile--wide {
    grid-column: 1 / -1;
  }
}

.dashboard .widget,
.dashboard .widget-skeleton {
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.dashboard .widget::before {
  height: 3px;
  background: var(--widget-accent, var(--module-accent));
  opacity: 1;
}

.dashboard .widget__header {
  min-height: 54px;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
}

.dashboard .widget__title,
.dashboard .widget__link {
  min-width: 0;
}

.dashboard .widget__body,
.dashboard .notes-grid-widget,
.dashboard .weather-widget__inner {
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.dashboard .widget__empty {
  padding: var(--space-4);
}

.dashboard .task-item,
.dashboard .event-item,
.dashboard .meal-slot,
.dashboard .shopping-widget-list,
.dashboard .note-item {
  border-radius: 8px;
}

.dashboard .task-item:hover,
.dashboard .event-item:hover,
.dashboard .meal-slot:hover,
.dashboard .shopping-widget-list:hover,
.dashboard .note-item:hover {
  transform: none;
}

.dashboard .weather-widget {
  border-radius: 8px;
}

.dashboard .weather-widget__refresh {
  top: var(--space-3);
  right: var(--space-3);
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.birthday-widget-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
  background: var(--color-surface-2);
  cursor: pointer;
  touch-action: pan-y;
}

.birthday-widget-item + .birthday-widget-item {
  margin-top: var(--space-2);
}

.birthday-widget-item__avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--module-birthdays) 14%, transparent);
  color: var(--module-birthdays);
  font-weight: var(--font-weight-bold);
  font-size: var(--text-sm);
}

.birthday-widget-item__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.birthday-widget-item__body {
  min-width: 0;
}

.birthday-widget-item__name {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.birthday-widget-item__meta {
  margin-top: 2px;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.birthday-widget-item__age {
  min-width: 34px;
  text-align: center;
  padding: var(--space-1) var(--space-2);
  border-radius: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
}

.family-widget {
  padding: var(--space-4);
}

.family-widget__count {
  color: var(--color-text-primary);
  font-size: var(--text-3xl);
  line-height: 1;
  font-weight: var(--font-weight-bold);
}

.family-widget__meta {
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.family-widget__avatars {
  display: flex;
  align-items: center;
  margin-top: var(--space-4);
  padding-left: var(--space-1);
}

.family-widget-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--font-weight-bold);
  font-size: var(--text-xs);
  border: 2px solid var(--color-surface);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.family-widget-avatar + .family-widget-avatar {
  margin-left: -8px;
}

.family-widget-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.budget-widget {
  padding: var(--space-4);
}

.budget-widget__headline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.budget-widget__headline span {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
}

.budget-widget__balance {
  color: var(--color-text-primary);
  font-size: var(--text-xl);
  white-space: nowrap;
}

.budget-widget__balance--positive {
  color: var(--color-success);
}

.budget-widget__balance--negative {
  color: var(--color-danger);
}

.budget-widget__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.budget-widget-metric {
  min-width: 0;
  padding: var(--space-3);
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.budget-widget-metric span {
  display: block;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-widget-metric strong {
  display: block;
  margin-top: 2px;
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-widget-metric--income strong {
  color: var(--color-success);
}

.budget-widget-metric--expense strong {
  color: var(--color-danger);
}

.budget-widget__footer {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
  background: color-mix(in srgb, var(--module-budget) 10%, transparent);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  line-height: 1.4;
}

@media (max-width: 520px) {
  .dashboard {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .dashboard-overview {
    margin-left: calc(var(--space-3) * -1);
    margin-right: calc(var(--space-3) * -1);
    border-left: 0;
    border-right: 0;
  }

  .dashboard-overview__tools {
    align-items: stretch;
  }

  .dashboard-overview__actions {
    flex: 1;
  }

  .dashboard-action__label {
    display: none;
  }

  .dashboard-action {
    width: 38px;
    justify-content: center;
    padding: 0;
  }

  .dashboard-kpi {
    min-height: 82px;
  }
}
