/* ═══════════════════════════════════════════════════════════════════ */
/* DASHBOARD V4 — Card-System mit Modus-Varianten                   */
/* Modes: erwachsene (default), kinder, senioren, formal            */
/* ═══════════════════════════════════════════════════════════════════ */

:root {
  --d-blue: #0A2E4D;
  --d-blue-l: #006D8F;
  --d-orange: #FF5A1F;
  --d-amber: #FFB000;
  --d-ink: #222831;
  --d-muted: #666;
  --d-border: #e6edf3;
  --d-bg: #f5f7fa;
  --d-card: #ffffff;
  --d-r: 12px;
}

/* ───── BASE: Horizontal lock ───── */
body.page-dashboard,
body.page-dashboard .layout,
body.page-dashboard .content {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}
body.page-dashboard {
  background: var(--d-bg);
  color: var(--d-ink);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-overflow-scrolling: touch;
}
body.page-dashboard * { box-sizing: border-box; }
body.page-dashboard .sidebar { display: none !important; }
body.page-dashboard .content { padding: 0; }
body.page-dashboard header.topbar #globalHelperAvatar {
  display: none !important;
}

.dash {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 14px 24px;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* HERO: Avatar + Name + Buttons                                    */
/* ═══════════════════════════════════════════════════════════════════ */
.dash-hero {
  text-align: center;
  padding: 16px 0 8px;
}

.dash-avatar-wrap {
  position: relative;
  display: inline-block;
  width: 72px;
  height: 72px;
}
.dash-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--d-amber);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: opacity 0.3s, transform 0.2s;
}
.dash-avatar-wrap:hover .dash-avatar { transform: scale(1.05); }

.dash-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--d-amber);
  opacity: 0;
  animation: pulse 2.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pulse {
  0%   { transform: scale(1);    opacity: 0.5; }
  50%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1);    opacity: 0; }
}

.dash-helper-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--d-blue);
  margin: 6px 0 0;
}
@media (max-width: 767px) {
  /* Feinjustierung: Label unter dem Avatar auf Mobile leicht nach rechts */
  .dash-helper-name { transform: translateX(12px); }
}

.dash-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}
.dash-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.dash-btn-speak { background: var(--d-orange); color: #fff; }
.dash-btn-speak:hover { background: #E14D1A; }
.dash-btn-chat  { background: var(--d-blue-l); color: #fff; }
.dash-btn-chat:hover  { background: #005a76; }

/* ═══════════════════════════════════════════════════════════════════ */
/* GREETING CARD                                                    */
/* ═══════════════════════════════════════════════════════════════════ */
.dash-greeting-card {
  background: linear-gradient(135deg, var(--d-blue) 0%, var(--d-blue-l) 100%);
  color: #fff;
  border-radius: var(--d-r);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.dash-greeting {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
}
.dash-context {
  font-size: 13px;
  opacity: 0.85;
  margin: 0 0 8px;
  line-height: 1.4;
}
.dash-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  opacity: 0.95;
}
.dash-meta a {
  color: inherit;
  text-decoration: none;
}
.dash-meta a:hover { text-decoration: underline; }
.dash-plan-badge {
  background: var(--d-amber);
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 11px;
}
.dash-meta-item {
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.dash-greeting-card .quota-widget {
  background: rgba(255,255,255,0.06);
  padding: 10px 12px;
  margin-top: 10px;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* SECTION CARDS (generic)                                          */
/* ═══════════════════════════════════════════════════════════════════ */
.dash-section {
  margin-bottom: 14px;
}
.dash-section > h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--d-blue);
  margin: 0 0 8px;
}
.dash-card-wrap {
  background: var(--d-card);
  border: 1px solid #d0d7de;
  border-radius: var(--d-r);
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dash-more-link {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--d-blue-l);
  text-decoration: none;
  font-weight: 600;
  margin-top: 6px;
}
.dash-more-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════════ */
/* MEMORY ITEMS                                                     */
/* ═══════════════════════════════════════════════════════════════════ */
.memory-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--d-border);
  font-size: 13px;
  line-height: 1.5;
}
.memory-item:last-child { border-bottom: none; }
.memory-label {
  font-size: 11px;
  color: var(--d-muted);
  margin-bottom: 2px;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* EMAIL ITEMS                                                      */
/* ═══════════════════════════════════════════════════════════════════ */
.email-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--d-border);
  font-size: 13px;
}
.email-item:last-child { border-bottom: none; }
.email-from { font-weight: 600; font-size: 12px; }
.email-subject { font-size: 12px; color: var(--d-ink); }
.email-date { font-size: 10px; color: var(--d-muted); }

/* ═══════════════════════════════════════════════════════════════════ */
/* SHARED ITEMS (events, tasks, notes, reports, contacts)           */
/* ═══════════════════════════════════════════════════════════════════ */
.event-item {
  padding: 4px 0;
  border-bottom: 1px solid var(--d-border);
  font-size: 12px;
}
.event-item:last-child { border-bottom: none; }

.note-item, .task-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  background: var(--d-bg);
  border-radius: 6px;
  font-size: 12px;
}

.report-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--d-border);
  font-size: 12px;
}
.report-item:last-child { border-bottom: none; }
.report-title { font-weight: 600; }
.report-meta { font-size: 10px; color: var(--d-muted); }
.report-action {
  background: var(--d-blue);
  color: #fff;
  border: none;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.dash-loading, .loading {
  text-align: center;
  color: var(--d-muted);
  font-size: 12px;
  font-style: italic;
  padding: 8px 0;
  margin: 0;
}
.dash-empty {
  text-align: center;
  color: var(--d-muted);
  font-size: 12px;
  padding: 12px 0;
  margin: 0;
}
.empty-state {
  text-align: center;
  color: var(--d-muted);
  padding: 10px 4px;
  font-size: 12px;
}
.empty-state-link {
  color: var(--d-blue-l);
  text-decoration: none;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* DIENSTE: Startseiten-Tiles                                       */
/* ═══════════════════════════════════════════════════════════════════ */
.dash-section[data-card="services"] > h3 {
  font-size: 14px;
}
.dash-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.dash-tiles > li { min-width: 0; }
.dash-tile {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-decoration: none;
  color: var(--d-ink);
  background: var(--d-card);
  border: 1px solid var(--d-border);
  border-radius: var(--d-r);
  padding: 12px;
  transition: transform 0.15s, box-shadow 0.2s;
  height: 100%;
  min-width: 0;
}
.dash-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.dash-tile .t-ico {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}
.dash-tile strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}
.dash-tile small {
  font-size: 11px;
  line-height: 1.3;
  opacity: 0.7;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.dash-tile > div:nth-child(2) { min-width: 0; }

@media (max-width: 430px) {
  /* Sehr schmale Handys: eine Spalte statt Textabschneiden */
  .dash-tiles { grid-template-columns: 1fr; }
  .dash-tile small {
    -webkit-line-clamp: 3;
  }
}
.dash-tile .t-star {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  padding: 0;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.dash-tile .t-star:hover { opacity: 1; }
.dash-tile .t-star.active { opacity: 1; color: var(--d-amber); }
.dash-tile .t-badge {
  background: var(--d-amber);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 6px;
  flex-shrink: 0;
}
.dash-fav-row { margin-bottom: 14px; }

/* Big link (e.g. hearing shortcut) */
.dash-big-link {
  display: flex;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  color: var(--d-ink);
  background: var(--d-card);
  border: 2px solid var(--d-blue-l);
  border-radius: var(--d-r);
  padding: 16px;
  transition: all 0.15s;
}
.dash-big-link:hover { background: #eef6fa; }
.dash-big-ico { font-size: 32px; }
.dash-big-link strong { font-size: 16px; display: block; margin-bottom: 2px; }
.dash-big-link small { font-size: 12px; opacity: 0.7; }

/* ═══════════════════════════════════════════════════════════════════ */
/* KIDS MODE                                                        */
/* ═══════════════════════════════════════════════════════════════════ */
.dash-kids-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dash-kids-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  border-radius: 16px;
  background: var(--kid-bg, #FF6B35);
  color: #fff;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.dash-kids-btn:hover { transform: scale(1.03); }
.dash-kids-ico { font-size: 32px; }
.dash-kids-btn strong { font-size: 15px; font-weight: 700; }

body.mode-kinder .dash-greeting-card {
  background: linear-gradient(135deg, #FF6B35 0%, #F59E0B 100%);
}
body.mode-kinder .dash-greeting {
  font-size: 22px;
}
body.mode-kinder .dash-helper-name {
  font-size: 22px;
  color: #FF6B35;
}
body.mode-kinder .dash-avatar {
  border-color: #FF6B35;
  border-width: 4px;
}
body.mode-kinder .dash-pulse {
  border-color: #FF6B35;
}
body.mode-kinder .dash-meta { display: none; }

/* ═══════════════════════════════════════════════════════════════════ */
/* SENIORS MODE                                                     */
/* ═══════════════════════════════════════════════════════════════════ */
body.mode-senioren .dash-greeting { font-size: 22px; }
body.mode-senioren .dash-context { font-size: 15px; }
body.mode-senioren .dash-section > h3 { font-size: 17px; }
body.mode-senioren .dash-card-wrap { font-size: 15px; padding: 16px; }
body.mode-senioren .dash-btn { padding: 12px 28px; font-size: 16px; border-radius: 14px; }
body.mode-senioren .dash-avatar-wrap,
body.mode-senioren .dash-avatar,
body.mode-senioren .dash-pulse { width: 88px; height: 88px; }
body.mode-senioren .dash-helper-name { font-size: 22px; }
body.mode-senioren .dash-big-link { padding: 20px; }
body.mode-senioren .dash-big-ico { font-size: 40px; }
body.mode-senioren .dash-big-link strong { font-size: 18px; }
body.mode-senioren .dash-big-link small { font-size: 14px; }
body.mode-senioren .event-item { font-size: 15px; padding: 8px 0; }
body.mode-senioren .memory-item { font-size: 15px; }

/* ═══════════════════════════════════════════════════════════════════ */
/* BUSINESS/FORMAL MODE                                             */
/* ═══════════════════════════════════════════════════════════════════ */
body.mode-formal .dash-greeting-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 8px;
}
body.mode-formal .dash-btn { border-radius: 6px; }
body.mode-formal .dash-card-wrap { border-radius: 8px; }
body.mode-formal .dash-tile { border-radius: 8px; }

/* ═══════════════════════════════════════════════════════════════════ */
/* FAB + COMMAND PALETTE                                            */
/* ═══════════════════════════════════════════════════════════════════ */
.dash-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--d-amber);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 90;
  transition: transform 0.2s;
}
.dash-fab:hover { transform: scale(1.1); }

.dash-cmd-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.dash-cmd {
  background: #fff;
  border-radius: var(--d-r);
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  max-width: 500px;
  width: 92%;
}
.dash-cmd-input {
  width: 100%;
  padding: 14px;
  border: none;
  border-bottom: 1px solid var(--d-border);
  font-size: 16px;
  outline: none;
}
.dash-cmd-results {
  max-height: 300px;
  overflow-y: auto;
  padding: 8px;
}
.command-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.command-item:hover { background: var(--d-bg); }

/* ═══════════════════════════════════════════════════════════════════ */
/* DESKTOP (>= 768px)                                               */
/* ═══════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .dash { padding: 0 24px 32px; }
  .dash-hero { padding: 24px 0 14px; }
  .dash-avatar-wrap, .dash-avatar, .dash-pulse { width: 96px; height: 96px; }
  .dash-helper-name { font-size: 22px; }
  .dash-btn { padding: 10px 28px; font-size: 15px; }
  .dash-greeting-card { padding: 20px 24px; }
  .dash-greeting { font-size: 22px; }
  .dash-tiles { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .dash-fab { width: 56px; height: 56px; font-size: 26px; bottom: 28px; right: 28px; }
}

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