/* ==========================================================================
   FamVibe Master Stylesheet (styles.css) - Complete Self-Contained Bundle
   ========================================================================== */

:root {
  /* Primary & Accent Palette */
  --primary-h: 245;
  --primary-s: 82%;
  --primary-l: 62%;
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-hover: hsl(var(--primary-h), var(--primary-s), 52%);
  --primary-light: hsl(var(--primary-h), 100%, 96%);

  --accent-h: 330;
  --accent: hsl(var(--accent-h), 85%, 60%);

  --warning-h: 38;
  --warning: hsl(var(--warning-h), 95%, 54%);
  --warning-light: hsl(var(--warning-h), 100%, 94%);

  --success-h: 152;
  --success: hsl(var(--success-h), 75%, 42%);
  --success-light: hsl(var(--success-h), 80%, 95%);

  --danger-h: 0;
  --danger: hsl(var(--danger-h), 84%, 60%);
  --danger-light: hsl(var(--danger-h), 100%, 95%);

  --info-h: 198;
  --info: hsl(var(--info-h), 88%, 48%);
  --info-light: hsl(var(--info-h), 100%, 94%);

  --star-gold: #f59e0b;
  --star-glow: rgba(245, 158, 11, 0.4);

  /* Family Member Personal Colors (High-Contrast for Mobile) */
  --user-papa: #2563eb;
  --user-Papa: #2563eb;
  --user-mama: #db2777;
  --user-Mama: #db2777;
  --user-samuel: #0284c7;
  --user-Samuel: #0284c7;
  --user-marlon: #059669;
  --user-Marlon: #059669;
  --user-kind1: #0284c7;
  --user-kind2: #059669;

  /* Neutral Light Palette */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-color: #e2e8f0;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Shadows & Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.06);

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & Safety Sizing */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img, svg {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

#app-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all var(--transition-normal);
}

.device-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-main);
}

/* App Header & Clean Layout */
.app-header {
  height: 68px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}

.header-left {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.logo-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  display: block;
}

.logo-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  display: block;
  white-space: nowrap;
}

.header-center {
  flex: 1;
  max-width: 420px;
  margin: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.announcement-ticker {
  background: #fef3c7;
  color: #92400e;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#ticker-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stars-widget {
  background: linear-gradient(135deg, #fffdf0 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.82rem;
  color: #b45309;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Universal Button Reset & Filter Pills */
button {
  font-family: var(--font-body);
}

.filter-pill, .tab-btn, .subtab-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-pill:hover, .tab-btn:hover, .subtab-pill:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.filter-pill.active, .tab-btn.active, .subtab-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* Dropdown Menus & Notifications */
.dropdown-container, .user-switcher-dropdown {
  position: relative;
}

.dropdown-menu, .user-menu {
  display: none !important;
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  z-index: 10000 !important;
  min-width: 280px;
  padding: 16px;
}

.dropdown-menu.active, .user-menu.active {
  display: block !important;
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-header h4 {
  font-size: 0.92rem;
  font-weight: 700;
}

.text-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 3px 8px;
}

.text-btn:hover {
  background: var(--primary-light);
}

/* FAB Quick-Action Speed Dial Popup Sheet */
.fab-quick-sheet {
  display: none !important;
  position: fixed !important;
  bottom: 80px !important;
  left: 50% !important;
  transform: translateX(-50%) translateY(20px) !important;
  width: 92% !important;
  max-width: 440px !important;
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(16px) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  padding: 16px !important;
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.25) !important;
  z-index: 10005 !important;
  transition: all var(--transition-normal) !important;
}

.fab-quick-sheet.active {
  display: block !important;
  transform: translateX(-50%) translateY(0) !important;
  animation: fabSheetSlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@keyframes fabSheetSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.fab-sheet-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 14px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.fab-sheet-header strong {
  font-family: var(--font-heading) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
}

.fab-actions-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 10px !important;
}

.fab-action-btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 12px 6px !important;
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  cursor: pointer !important;
  transition: var(--transition-fast) !important;
}

.fab-action-btn:hover {
  background: var(--primary-light) !important;
  border-color: var(--primary) !important;
  transform: translateY(-2px) !important;
}

.fab-action-btn span {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
}

.fab-icon-box {
  width: 36px !important;
  height: 36px !important;
  border-radius: var(--radius-sm) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
  font-size: 1rem !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
}

.fab-icon-box.bg-primary { background: #6366f1 !important; }
.fab-icon-box.bg-info { background: #0ea5e9 !important; }
.fab-icon-box.bg-danger { background: #ef4444 !important; }
.fab-icon-box.bg-warning { background: #f59e0b !important; }
.fab-icon-box.bg-success { background: #10b981 !important; }
.fab-icon-box.bg-accent { background: #ec4899 !important; }

.user-selector-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-selector-btn:hover {
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.app-body {
  display: flex;
  flex: 1;
  width: 100%;
}

.sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-section {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.content-area {
  flex: 1;
  background: var(--bg-main);
  padding: 24px;
  padding-bottom: 90px;
  overflow-y: auto;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

/* School Child Tabs Bar (Samuel / Marlon selector) */
.child-tabs-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.child-tabs-bar .tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.child-tabs-bar .tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* School Navigation Sub-Tab Pills */
.school-nav-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.subtab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.subtab-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.subtab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* School Subtab Content Panels */
.school-subtab-content {
  display: none;
}

.school-subtab-content.active {
  display: block;
}

/* Privacy Banner (for child profile views) */
.privacy-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 500;
  color: #92400e;
  margin-bottom: 16px;
}

.privacy-banner.hidden {
  display: none;
}

/* Subtab Header (exam/homework section headers) */
.subtab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.greeting {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.subtext {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* User Avatar & Profile Switcher Sizing */
.avatar-xs {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: inline-block !important;
}

.avatar-sm {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: inline-block !important;
}

.avatar-md {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: inline-block !important;
}

.avatar-lg {
  width: 64px !important;
  height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: inline-block !important;
}

.user-avatar, .user-avatar img, .profile-avatar-img, #header-user-avatar {
  width: 42px !important;
  height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.profile-chip-avatar {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.avatar-preset-img {
  width: 54px !important;
  height: 54px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

/* Calendar Component Styling */
.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.month-navigator {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.month-navigator h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  min-width: 160px;
  text-align: center;
  color: var(--text-main);
}

.cal-category-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-grid-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.calendar-weekdays {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 6px !important;
  text-align: center !important;
  margin-bottom: 10px !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.calendar-weekdays span {
  display: block;
  text-align: center;
}

.calendar-days-grid {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 8px !important;
}

.cal-day-cell {
  min-height: 90px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: var(--transition-fast);
}

.cal-day-cell:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

.cal-day-cell.today {
  border: 2px solid var(--primary);
  background: rgba(99, 102, 241, 0.06);
}

.cal-day-cell.today .day-number {
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.day-events-pill {
  font-size: 0.72rem;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

.day-events-pill.Geburtstag { background: #fef3c7; color: #b45309; }
.day-events-pill.Arzt { background: #fee2e2; color: #991b1b; }
.day-events-pill.Schule { background: #e0e7ff; color: #3730a3; }
.day-events-pill.Freizeit { background: #dcfce7; color: #166534; }
.day-events-pill.Müll { background: #f3e8ff; color: #6b21a8; }

/* Dashboard Cards & Vibrant Pastel Tints */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.dash-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: var(--transition-fast);
}

.dash-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.dash-card.card-events {
  background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
  border: 1px solid #c7d2fe;
  border-left: 5px solid #6366f1;
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.12);
}
.dash-card.card-tasks {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #a7f3d0;
  border-left: 5px solid #10b981;
  box-shadow: 0 8px 24px -4px rgba(16, 185, 129, 0.12);
}
.dash-card.card-routines {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
  border: 1px solid #ddd6fe;
  border-left: 5px solid #8b5cf6;
  box-shadow: 0 8px 24px -4px rgba(139, 92, 246, 0.12);
}
.dash-card.card-birthdays {
  background: linear-gradient(135deg, #fffdf0 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  border-left: 5px solid #f59e0b;
  box-shadow: 0 8px 24px -4px rgba(245, 158, 11, 0.12);
}
.dash-card.card-notes {
  background: linear-gradient(135deg, #fff5f8 0%, #fce7f3 100%);
  border: 1px solid #fbcfe8;
  border-left: 5px solid #ec4899;
  box-shadow: 0 8px 24px -4px rgba(236, 72, 153, 0.12);
}
.dash-card.card-meals {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
  border-left: 5px solid #0ea5e9;
  box-shadow: 0 8px 24px -4px rgba(14, 165, 233, 0.12);
}
.dash-card.card-rules {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border: 1px solid #fecdd3;
  border-left: 5px solid #f43f5e;
  box-shadow: 0 8px 24px -4px rgba(244, 63, 94, 0.12);
}

.dash-card.span-2 {
  grid-column: span 2;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Task & Routine Rows */
.task-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.task-item-row:hover {
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: var(--transition-fast);
}

.checkbox-custom.checked {
  background: var(--success);
  border-color: var(--success);
}

.task-label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
}

.task-label.done {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  text-decoration: none;
  font-family: inherit;
  line-height: 1.2;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.btn-light {
  background: #ffffff !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

.btn-light:hover {
  background: var(--bg-subtle) !important;
  border-color: #cbd5e1 !important;
  color: var(--primary) !important;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
}

.icon-link:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
  border-color: rgba(99, 102, 241, 0.15);
}

.mobile-toggle-btn {
  display: none !important;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  color: #ffffff !important;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.55);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--primary);
  color: var(--primary);
}

.icon-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 5px;
  min-width: 16px;
  height: 16px;
  line-height: 12px;
  text-align: center;
  border-radius: 10px;
  border: 2px solid var(--bg-surface);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  pointer-events: none;
}

.icon-btn-sm {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--text-muted);
  border-radius: 4px;
  transition: var(--transition-fast);
  font-family: inherit;
}

.icon-btn-sm:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.assignee-tag {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 5px 13px !important;
  border-radius: var(--radius-full) !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  line-height: 1.2 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
  letter-spacing: 0.3px !important;
  white-space: nowrap !important;
  border: 1.5px solid rgba(255, 255, 255, 0.5) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
  transition: transform var(--transition-fast) !important;
}

.assignee-tag:hover {
  transform: scale(1.06) !important;
}

/* User Specific Vibrant High-Contrast Gradients */
.assignee-tag.user-tag-mama {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4) !important;
}
.assignee-tag.user-tag-papa {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4) !important;
}
.assignee-tag.user-tag-samuel {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4) !important;
}
.assignee-tag.user-tag-marlon {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
}
.assignee-tag.user-tag-all, .assignee-tag.user-tag-familie {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%) !important;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4) !important;
}
.assignee-tag.user-tag-pool {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4) !important;
}

.nav-badge {
  margin-left: auto;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.gpa-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 0.9rem;
}

.role-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.color-primary { color: var(--primary) !important; }
.color-success { color: var(--success) !important; }
.color-warning { color: var(--warning) !important; }
.color-danger { color: var(--danger) !important; }
.color-info { color: var(--info) !important; }
.color-accent { color: var(--accent) !important; }

.empty-state-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 500;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  text-align: center;
}

.event-item-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.event-item-mini .time-box {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.event-item-mini .event-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
}

.note-sticky {
  background: #fef08a;
  color: #713f12;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  position: relative;
  font-size: 0.88rem;
  font-weight: 500;
}

.note-sticky.bg-pink { background: #fbcfe8; color: #831843; }
.note-sticky.bg-blue { background: #bae6fd; color: #075985; }
.note-sticky.bg-green { background: #bbf7d0; color: #14532d; }

.note-author {
  display: block;
  font-size: 0.72rem;
  margin-top: 8px;
  opacity: 0.8;
  font-weight: 600;
}

.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  color: #92400e;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.alert-banner .banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.chat-notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.call-btn-big {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
  transition: var(--transition-fast);
}

.call-btn-big:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.call-btn-big.secondary {
  background: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.call-btn-big.info {
  background: #0ea5e9;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.25);
}

.mobile-fab-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  color: #fff;
  border: none;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: var(--transition-fast);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.badge-star {
  background: #fef3c7;
  color: #b45309;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

/* Modals & Body Scroll Lock */
body.modal-open {
  overflow: hidden !important;
  touch-action: none !important;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000 !important;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: auto;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-body {
  padding: 20px 24px;
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg-surface);
  color: var(--text-main);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #0f172a;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.success { background: #059669; }
.toast.warning { background: #d97706; }
.toast.danger { background: #dc2626; }
.toast.info { background: #2563eb; }

/* Mobile Bottom Nav */
.mobile-bottom-nav {
  display: none;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 72px !important;
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.08);
  z-index: 9999 !important;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom);
  align-items: stretch;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 4px;
  flex: 1;
  min-width: 0;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.mobile-nav-item i {
  font-size: 1.6rem !important;
  line-height: 1;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-nav-item span {
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  line-height: 1.1;
}

.mobile-nav-item.active {
  color: var(--primary) !important;
  font-weight: 800 !important;
}

.mobile-nav-item.active i {
  transform: translateY(-2px) scale(1.15);
  color: var(--primary) !important;
}

.mobile-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 4px;
  background: var(--primary);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

@media (max-width: 900px) {
  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body {
    background-color: var(--bg-main) !important;
  }

  .app-header {
    padding: 10px 14px !important;
    gap: 8px !important;
  }

  .header-center {
    display: none !important; /* Hide ticker on mobile header for space */
  }

  .logo-sub {
    display: none !important; /* Hide sub-logo on mobile */
  }

  .user-selector-btn span {
    display: none !important; /* Avatar icon only on mobile header */
  }

  .sidebar {
    display: none !important;
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  .main-content, .content-area {
    padding: 14px 14px 90px 14px !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .subtab-bar, .filter-bar, .assignee-pills-row, .task-filter-row, div[style*="display: flex; gap: 8px; flex-wrap: wrap"] {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    padding-bottom: 6px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .dashboard-grid, .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .dash-card.span-2, .dash-card.span-3 {
    grid-column: span 1 !important;
  }

  .calendar-days-grid, .calendar-weekdays {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 3px !important;
  }

  .cal-day-cell {
    min-height: 52px !important;
    padding: 4px !important;
    font-size: 0.72rem !important;
  }

  .card, .dash-card {
    padding: 14px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}
