/* Main View Container */
.view {
  display: none;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--spacing-4);
  padding-bottom: calc(var(--nav-height) + 100px);
}
.view.active {
  display: block;
}

/* Login View */
.login-view.active {
  display: flex;
}
.login-view {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: var(--spacing-6);
  background: var(--gradient-primary);
  color: white;
}
.login-card {
  background: var(--surface);
  color: var(--text-primary);
  width: 100%;
  max-width: 400px;
  padding: var(--spacing-6);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-surface);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: var(--spacing-3);
  padding-bottom: var(--safe-area-bottom);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 40;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  gap: var(--spacing-1);
  position: relative;
}
.nav-item svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
  transition: all var(--transition-fast);
}
.nav-item.active {
  color: var(--primary);
  font-weight: 500;
}
.nav-item.active svg {
  stroke-width: 2.5;
  transform: translateY(-2px);
}
.nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-weight: bold;
  border-radius: var(--radius-full);
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dashboard View */
.dashboard-header {
  margin-bottom: var(--spacing-6);
}
.dashboard-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}
.dashboard-header .date {
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.dashboard-section {
  margin-bottom: var(--spacing-6);
}
.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--spacing-3);
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
}

/* Fridge Board */
.fridge-board {
  background: linear-gradient(105deg, #e2e8f0 0%, #f8fafc 40%, #e2e8f0 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.1), 0 10px 30px rgba(0,0,0,0.2);
  min-height: calc(100vh - 150px);
  position: relative;
}

.magnet-item {
  background: var(--magnet-bg);
  border-radius: 4px;
  padding: 12px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
  position: relative;
  margin-bottom: 16px;
  color: var(--magnet-text);
  border: 1px solid var(--border);
}
.magnet-item::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: #334155;
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.4), 0 2px 4px rgba(0,0,0,0.4);
}
/* Tilt magnets swing from the nail at their top-center */
.tilt-magnet {
  transform-origin: 50% -8px;
}

.sticky-note-item {
  background: #fef08a;
  padding: 16px;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.2);
  font-family: 'Amatic SC', cursive;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
  color: #422006;
  position: relative;
  margin-bottom: 16px;
}
.sticky-note-item::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 20px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Timeline Cards */
.timeline-card {
  display: flex;
  gap: var(--spacing-3);
  margin-bottom: var(--spacing-3);
}
.timeline-time {
  min-width: 50px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
}
.timeline-content {
  flex: 1;
  background: var(--surface);
  padding: var(--spacing-3);
  border-radius: var(--radius-md);
  border-right: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Bulletin Board */
.bulletin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--spacing-4);
}

/* Calendar View */
.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-4);
}
.week-strip {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--spacing-4);
}
.day-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-1);
}
.day-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.day-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-weight: 500;
}
.day-col.active .day-num {
  background: var(--primary);
  color: white;
}
.day-dots {
  display: flex;
  gap: 2px;
}
.dot {
  width: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--primary);
}

/* Month Grid */
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.month-cell {
  background: var(--surface);
  min-height: 60px;
  padding: var(--spacing-1);
  display: flex;
  flex-direction: column;
}
.month-cell-header {
  text-align: left;
  font-size: 0.75rem;
}
.month-cell.today .month-cell-header {
  color: var(--primary);
  font-weight: bold;
}
.month-cell.other-month {
  background: var(--bg-primary);
  color: var(--text-secondary);
}

/* Task Item */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-3);
  padding: var(--spacing-3);
  background: var(--surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-3);
  box-shadow: var(--shadow-sm);
}
.task-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.task-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
}
.task-checkbox.checked::after {
  content: '';
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}
.task-content {
  flex: 1;
}
.task-title {
  font-weight: 500;
  margin-bottom: var(--spacing-1);
}
.task-meta {
  display: flex;
  gap: var(--spacing-2);
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.task-item.completed {
  opacity: 0.6;
}
.task-item.completed .task-title {
  text-decoration: line-through;
}

/* Contact Card */
.contact-card {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: var(--spacing-3);
  background: var(--surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-3);
  box-shadow: var(--shadow-sm);
}
.contact-info {
  flex: 1;
}
.contact-name {
  font-weight: 600;
  margin-bottom: 2px;
}
.contact-phone {
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.contact-action {
  width: 40px;
  height: 40px;
  background: var(--secondary-light);
  color: var(--secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Settings */
.settings-group {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-4);
  overflow: hidden;
}
.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-4);
  border-bottom: 1px solid var(--border);
}
.settings-item:last-child {
  border-bottom: none;
}
.settings-item-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
}
