/* ========================================================
   EVP Superchat – Prototyp Styles
   ======================================================== */

:root {
  --color-primary: #16a34a;
  --color-primary-dark: #15803d;
  --color-primary-light: #bbf7d0;
  --color-primary-bg: #f0fdf4;
  --color-accent: #f59e0b;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-bg: #ffffff;
  --color-surface: #f8fafc;
  --color-border: #e2e8f0;
  --color-error: #ef4444;
  --color-bot-bubble: #f1f5f9;
  --color-user-bubble: var(--color-primary);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.15);
  --shadow-xl: 0 12px 40px rgba(0,0,0,.2);

  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --chat-width: 400px;
  --chat-height: 600px;
  --fab-size: 60px;
}

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

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: #fff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ========================================================
   HOST PAGE – Platzhalter
   ======================================================== */

.host-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

/* ========================================================
   CHAT WIDGET – FAB (Floating Action Button)
   ======================================================== */

#chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-family);
}

#chat-fab {
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-lg);
  transition: transform .25s cubic-bezier(.4,0,.2,1), background .2s;
}

#chat-fab:hover {
  transform: scale(1.08);
  background: var(--color-primary-dark);
}

#chat-fab:active {
  transform: scale(.95);
}

.chat-fab__icon {
  width: 26px;
  height: 26px;
  position: absolute;
  transition: opacity .2s, transform .3s cubic-bezier(.4,0,.2,1);
}

.chat-fab__icon--chat {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.chat-fab__icon--close {
  opacity: 0;
  transform: rotate(-90deg) scale(.5);
}

#chat-widget.open .chat-fab__icon--chat {
  opacity: 0;
  transform: rotate(90deg) scale(.5);
}

#chat-widget.open .chat-fab__icon--close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.chat-fab__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: var(--color-error);
  border-radius: var(--radius-full);
  border: 2px solid #fff;
  animation: pulse-badge 2s infinite;
}

#chat-widget.open .chat-fab__badge,
.chat-fab__badge.hidden {
  display: none;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: .7; }
}

/* ========================================================
   CHAT WINDOW
   ======================================================== */

.chat-window {
  position: absolute;
  bottom: calc(var(--fab-size) + 16px);
  right: 0;
  width: var(--chat-width);
  height: var(--chat-height);
  max-height: calc(100vh - 100px);
  max-height: calc(100dvh - 100px);
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(.95);
  pointer-events: none;
  transition: opacity .3s cubic-bezier(.4,0,.2,1),
              transform .3s cubic-bezier(.4,0,.2,1);
}

#chat-widget.open .chat-window {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--color-primary);
  color: #fff;
  flex-shrink: 0;
}

.chat-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-header__avatar {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.2);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-header__avatar svg {
  width: 20px;
  height: 20px;
}

.chat-header__title {
  font-weight: 700;
  font-size: 1rem;
}

.chat-header__status {
  display: block;
  font-size: 0.75rem;
  opacity: .85;
}

.chat-header__close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background .2s;
}

.chat-header__close:hover {
  background: rgba(255,255,255,.15);
}

.chat-header__close svg {
  width: 20px;
  height: 20px;
}

/* Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

/* Message Bubbles */
.chat-bubble {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.5;
  animation: bubble-in .3s cubic-bezier(.4,0,.2,1);
  word-wrap: break-word;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble--bot {
  background: var(--color-bot-bubble);
  color: var(--color-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble--user {
  background: var(--color-user-bubble);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
  align-self: flex-start;
  background: var(--color-bot-bubble);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  animation: bubble-in .3s cubic-bezier(.4,0,.2,1);
}

.chat-typing__dot {
  width: 8px;
  height: 8px;
  background: var(--color-text-secondary);
  border-radius: var(--radius-full);
  animation: typing-bounce .6s infinite alternate;
}

.chat-typing__dot:nth-child(2) {
  animation-delay: .15s;
}

.chat-typing__dot:nth-child(3) {
  animation-delay: .3s;
}

@keyframes typing-bounce {
  from { opacity: .3; transform: translateY(0); }
  to   { opacity: 1;   transform: translateY(-4px); }
}

/* Quick Reply Buttons */
.chat-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: flex-start;
  animation: bubble-in .3s cubic-bezier(.4,0,.2,1);
}

.chat-quick-replies button {
  padding: 8px 16px;
  border: 1.5px solid var(--color-primary);
  background: var(--color-bg);
  color: var(--color-primary);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-family);
}

.chat-quick-replies button:hover {
  background: var(--color-primary);
  color: #fff;
}

.chat-quick-replies button:active {
  transform: scale(.96);
}

.chat-quick-replies.disabled button {
  pointer-events: none;
  opacity: .5;
}

/* Tariff Cards */
.chat-tariff-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  align-self: flex-start;
  animation: bubble-in .4s cubic-bezier(.4,0,.2,1);
}

.tariff-card {
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color .2s, box-shadow .2s;
}

.tariff-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.tariff-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tariff-card__logo {
  width: 48px;
  height: 48px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--color-text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
}

.tariff-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tariff-card__logo--svg {
  background: none;
  border: none;
  padding: 0;
}

.tariff-card__logo--svg svg {
  width: 100%;
  height: 100%;
}

.tariff-card__info {
  flex: 1;
  min-width: 0;
}

.tariff-card__provider {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.tariff-card__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.tariff-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tariff-card__price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-text);
}

.tariff-card__price span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.tariff-card__savings {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-bg);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.tariff-card__cta {
  display: block;
  text-align: center;
  padding: 10px;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background .2s;
}

.tariff-card__cta:hover {
  background: var(--color-primary-dark);
}

/* Info bubble (tip) */
.chat-bubble--tip {
  background: var(--color-primary-bg);
  border: 1px solid var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 0.82rem;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

/* Error bubble */
.chat-bubble--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--color-error);
  font-size: 0.85rem;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-bubble--error a {
  color: var(--color-error);
  font-weight: 600;
}

/* Loading spinner within bot bubble */
.chat-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  align-self: flex-start;
  background: var(--color-bot-bubble);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  animation: bubble-in .3s cubic-bezier(.4,0,.2,1);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.chat-loading__spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

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

/* Input Area */
.chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  outline: none;
  transition: border-color .2s;
  font-family: var(--font-family);
}

#chat-input:focus {
  border-color: var(--color-primary);
}

#chat-input:disabled {
  background: var(--color-surface);
  cursor: not-allowed;
}

#chat-send {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
  flex-shrink: 0;
}

#chat-send:hover {
  background: var(--color-primary-dark);
}

#chat-send:active {
  transform: scale(.92);
}

#chat-send:disabled {
  background: var(--color-border);
  cursor: not-allowed;
}

#chat-send svg {
  width: 18px;
  height: 18px;
}

/* ========================================================
   RESPONSIVE
   ======================================================== */

/* -- Reduced motion ------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* -- Tablet (481-768) ---------------------------------- */
@media (max-width: 768px) {
  .chat-window {
    width: 360px;
    --chat-height: 540px;
    height: var(--chat-height);
  }
}

/* -- Tablet landscape: taller chat window -------------- */
@media (min-width: 481px) and (max-width: 768px) and (orientation: landscape) {
  .chat-window {
    max-height: calc(100vh - 80px);
    max-height: calc(100dvh - 80px);
  }
}

/* -- Mobile (<=480) ------------------------------------ */
@media (max-width: 480px) {
  /* FAB slightly smaller on small phones */
  #chat-widget {
    bottom: 16px;
    right: 16px;
  }

  #chat-fab {
    width: 56px;
    height: 56px;
  }

  /* Fullscreen chat */
  #chat-widget.open .chat-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    padding-top: env(safe-area-inset-top, 0px);
  }

  #chat-widget.open #chat-fab {
    display: none;
  }

  /* Safe-area for input on devices with home bar */
  #chat-widget.open .chat-input-area {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  /* Header gets safe-area padding on top */
  #chat-widget.open .chat-header {
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
  }

  /* Bigger touch targets */
  .chat-quick-replies button {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .tariff-card__cta {
    padding: 12px;
    min-height: 44px;
    font-size: 0.9rem;
  }

  /* Tariff card bottom stacks on very narrow */
  .tariff-card__bottom {
    flex-wrap: wrap;
  }

  .tariff-card__savings {
    font-size: 0.72rem;
  }

  /* Larger close button tap target */
  .chat-header__close {
    padding: 8px;
    margin: -4px;
  }
}

/* -- Very small phones (<360px) ------------------------ */
@media (max-width: 360px) {
  .chat-bubble {
    max-width: 92%;
    font-size: 0.85rem;
    padding: 10px 12px;
  }

  .chat-quick-replies {
    gap: 6px;
  }

  .chat-quick-replies button {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .tariff-card {
    padding: 12px;
  }

  .tariff-card__logo {
    width: 40px;
    height: 40px;
  }

  .tariff-card__price {
    font-size: 1.15rem;
  }

  .chat-messages {
    padding: 16px 10px;
    gap: 10px;
  }
}

/* -- Mobile landscape ---------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
  #chat-widget.open .chat-window {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  #chat-widget.open #chat-fab {
    display: none;
  }

  .chat-header {
    padding: 10px 16px;
  }

  .chat-header__avatar {
    width: 28px;
    height: 28px;
  }

  .chat-header__avatar svg {
    width: 16px;
    height: 16px;
  }

  .chat-messages {
    padding: 12px;
    gap: 8px;
  }

  .chat-input-area {
    padding: 8px 12px;
  }

  #chat-input {
    height: 38px;
  }

  #chat-send {
    width: 38px;
    height: 38px;
  }
}

/* -- iOS auto-zoom prevention -------------------------- */
@supports (-webkit-touch-callout: none) {
  #chat-input {
    font-size: 16px;
  }
}

/* ========================================================
   FEEDBACK WIDGET – Position Override
   Chat FAB = 60px at bottom:24px. Feedback sits above it.
   ======================================================== */

#fb-float-wrapper {
  bottom: 24px !important;
  right: 96px !important;
}

#fb-badge {
  bottom: 90px !important;
  right: 92px !important;
}

#fb-toast {
  bottom: 92px !important;
  right: 96px !important;
}

@media (max-width: 480px) {
  #fb-float-wrapper {
    bottom: 16px !important;
    right: 84px !important;
  }

  #fb-badge {
    right: 80px !important;
  }

  #fb-toast {
    right: 16px !important;
    left: 16px !important;
    max-width: none !important;
  }

  body.chat-fullscreen #fb-float-wrapper,
  body.chat-fullscreen #fb-badge,
  body.chat-fullscreen #fb-toast {
    display: none !important;
  }
}

/* ========================================================
   DASHBOARD TOGGLE BUTTON (top of page)
   ======================================================== */

.top-buttons {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8000;
  display: flex;
  gap: 10px;
  white-space: nowrap;
}

.dashboard-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: border-color .2s, box-shadow .2s;
  white-space: nowrap;
  text-decoration: none;
}

.dashboard-toggle:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
}

.dashboard-toggle svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

.dashboard-toggle__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--color-error);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

/* ========================================================
   DASHBOARD OVERLAY
   ======================================================== */

.dashboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, .4);
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
}

.dashboard-overlay.visible {
  display: flex;
  overflow-y: auto;
  animation: dashboard-fade-in .2s ease;
}

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

.dashboard-panel {
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 80px);
  max-height: calc(100dvh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: dashboard-slide-in .25s cubic-bezier(.4,0,.2,1);
}

@keyframes dashboard-slide-in {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.dashboard-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.dashboard-close {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.dashboard-close:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

/* Stats */
.dashboard-stats {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  flex-shrink: 0;
}

.dashboard-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.dashboard-stat__num {
  font-size: 1.2rem;
  font-weight: 800;
}

.dashboard-stat__num--open { color: #d97706; }
.dashboard-stat__num--done { color: var(--color-primary); }
.dashboard-stat__num--total { color: var(--color-text); }

/* Tabs */
.dashboard-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px 12px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.dashboard-tab {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-family);
  transition: color .15s, border-color .15s;
}

.dashboard-tab:hover {
  color: var(--color-text);
}

.dashboard-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* List */
.dashboard-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-list::-webkit-scrollbar { width: 4px; }
.dashboard-list::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 4px; }

.dashboard-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.dashboard-empty--error {
  color: var(--color-error);
}

/* Card */
.dashboard-card {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color .15s;
}

.dashboard-card:hover {
  border-color: var(--color-primary-light);
}

.dashboard-card--done {
  opacity: .6;
}

.dashboard-card--done .dashboard-card__comment {
  text-decoration: line-through;
  text-decoration-color: var(--color-text-secondary);
}

.dashboard-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.dashboard-card__id {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.dashboard-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.dashboard-badge--open {
  background: #fffbeb;
  color: #d97706;
}

.dashboard-badge--done {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

.dashboard-card__time {
  font-size: 0.72rem;
  color: var(--color-text-secondary);
  margin-left: auto;
}

.dashboard-card__body {
  padding: 14px 16px;
}

.dashboard-card__comment {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 8px;
}

.dashboard-card__meta {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.dashboard-card__meta code {
  background: var(--color-surface);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.72rem;
}

.dashboard-card__snippet {
  font-style: italic;
}

.dashboard-card__path {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  font-family: monospace;
  word-break: break-all;
  opacity: .7;
}

.dashboard-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.dashboard-card__check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.dashboard-card__check input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.dashboard-card__actions {
  display: flex;
  gap: 6px;
}

.dashboard-card__btn {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-family: var(--font-family);
  transition: all .12s;
}

.dashboard-card__btn:hover {
  background: var(--color-surface);
  border-color: var(--color-text-secondary);
}

.dashboard-card__btn--jump {
  color: var(--color-primary);
  border-color: var(--color-primary-light);
}

.dashboard-card__btn--jump:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
}

.dashboard-card__btn--delete:hover {
  background: #fef2f2;
  color: var(--color-error);
  border-color: var(--color-error);
}

/* ========================================================
   HIGHLIGHT – Element Sprungmarke (pulsing outline)
   ======================================================== */

.fb-highlight {
  outline: 3px solid var(--color-primary) !important;
  outline-offset: 3px !important;
  animation: fb-highlight-pulse 1s ease-in-out 3;
  position: relative;
  z-index: 5000;
}

@keyframes fb-highlight-pulse {
  0%, 100% { outline-color: var(--color-primary); }
  50% { outline-color: transparent; }
}

/* ========================================================
   DASHBOARD RESPONSIVE
   ======================================================== */

@media (max-width: 480px) {
  .top-buttons {
    top: 12px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .dashboard-toggle {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .dashboard-overlay {
    padding: 0;
    align-items: stretch;
  }

  .dashboard-panel {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .dashboard-header {
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
  }

  .dashboard-stats {
    padding: 12px 16px;
  }

  .dashboard-stat {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .dashboard-stat__num {
    font-size: 1rem;
  }

  .dashboard-tabs {
    padding: 0 16px 10px;
  }

  .dashboard-list {
    padding: 12px 16px 20px;
  }

  .dashboard-card__head {
    padding: 10px 12px;
  }

  .dashboard-card__body {
    padding: 12px;
  }

  .dashboard-card__foot {
    padding: 8px 12px;
  }
}
