body {
  font-family: "Inter", system-ui, sans-serif;
  background: #0f172a;
  color: #f8fafc;
  margin: 0;
  padding: 2rem;
}
h1 {
  text-align: center;
  color: #f77f00;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
h1 svg {
  width: 28px;
  height: 28px;
  stroke: #f77f00;
  stroke-width: 2.2;
}
.container { max-width: 700px; margin: 0 auto; }

#stats {
  text-align: center;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

#last-update {
  text-align: center;
  font-size: 0.9rem;
  color: #f8fafc;
  margin-bottom: 0.25rem;
  opacity: 0.9;
}
/* Ready stats under average duration */
#ready-stats {
  text-align: center;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

/* Stats panel */
.stats-panel {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  margin-bottom: 1.25rem;
}
.feed-panel {
  background: transparent;      /* transparante achtergrond voor content */
  border-radius: 0.75rem;
  padding: 0;                   /* header krijgt eigen padding */
  box-shadow: none;             /* alleen header heeft schaduw */
  margin-bottom: 1.25rem;
}
.stats-header, .feed-header {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* pijl komt rechts via auto margin */
  gap: 8px;
  color: #f8fafc;
  font-weight: 600;
  margin-bottom: 0; /* vaste kop-hoogte: niet laten verspringen */
  cursor: pointer;
  user-select: none;
  position: relative;
}
.feed-header {
  background: #1e293b;          /* alleen de kop heeft paneel-look */
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.stats-header i, .feed-header i {
  width: 18px;
  height: 18px;
  color: #f59e0b;
}
.stats-header .chevron, .feed-header .chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #ffffff; /* alleen de pijl zichtbaar */
  margin-left: auto; /* pijl helemaal rechts */
  transition: transform .26s ease, color .2s ease;
}
.stats-header .chevron svg, .feed-header .chevron svg { stroke-width: 2.6; }
.stats-content, .feed-content {
  overflow: hidden;
  transition: max-height 340ms cubic-bezier(0.22, 0.61, 0.36, 1), opacity 280ms ease-in-out;
  will-change: max-height, opacity;
  opacity: 1;
}
.feed-content {
  margin-top: 0;                /* geen ruimte bij ingeklapt */
  padding-top: 0;               /* ruimte regelen we conditioneel bij open */
  padding-right: 20px;          /* meer afstand van de scrollbar */
}
.feed-panel:not(.collapsed) .feed-content {
  margin-top: 1rem;             /* ruimte tussen kop en scrollbar alleen bij open */
}
.stats-panel.collapsed .stats-content, .feed-panel.collapsed .feed-content {
  max-height: 0;
  opacity: 0;
}
.stats-panel.collapsed .stats-header .chevron, .feed-panel.collapsed .feed-header .chevron {
  transform: rotate(-90deg); /* wijst duidelijk naar rechts bij ingeklapt */
}

/* Ruimte onder koptekst uitsluitend binnen de content, zodat kop niet verspringt */
.stats-content > .stats-grid {
  padding-top: 0.75rem;
}
/* Zelfde spacingregel voor feed: ruimte onder kop binnen content */
.feed-content > #feed { padding-top: 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}
.stat-item {
  text-align: center;
  color: #cbd5e1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 0.6rem 0.75rem;
}

#refresh-timer {
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}
#refresh-progress {
  width: 100%;
  height: 4px;
  background: #1e293b;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
#refresh-progress .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f77f00, #f59e0b);
  transition: width 1s linear;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.summary-item {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform .3s ease, background-color .6s ease;
}
.summary-item.updated {
  background-color: #243045;
  transform: scale(1.03);
}

.summary-item h3 { margin: 0; font-size: 1rem; }
.summary-item .barcode-controls {
  display: flex;
  justify-content: center;
  margin-top: 0.25rem;
}
.summary-item .barcode-toggle {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 0.5rem;
  padding: 0.2rem 0.5rem; /* kleiner knopje */
  font-size: 0.8rem;     /* kleinere tekst */
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.summary-item .barcode-toggle:hover { background: #475569; border-color: #64748b; }
.summary-item .barcode-wrap {
  display: flex;
  justify-content: center;
  overflow: hidden;             /* voor animatie */
  max-height: 0;                /* start ingeklapt */
  opacity: 0;                   /* fade bij in-/uitklappen */
  margin-top: 0;                /* geen extra ruimte als ingeklapt */
  transition: max-height 240ms cubic-bezier(0.22, 0.61, 0.36, 1), opacity 200ms ease-in-out, margin-top 200ms ease-in-out;
}
.summary-item .barcode-wrap.open {
  opacity: 1;
  margin-top: 0.35rem;          /* ruimte verschijnt alleen bij uitgeklapt */
}
/* status behoudt vaste marge; barcode-wrap regelt eigen afstand bij open */
.summary-item .barcode {
  width: 220px;
  height: 48px;
}

/* Schatting voortgang bij 'Gestart' */
.summary-item .progress-estimate {
  margin-top: 0.4rem;
}
.summary-item .progress-track {
  width: 220px;        /* smaller than card width */
  max-width: 100%;     /* remain responsive on small screens */
  margin: 0 auto;      /* center under the status */
  height: 6px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  overflow: hidden;
}
.summary-item .progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #60a5fa, #22c55e);
  transition: width 0.5s ease;
}
.summary-item .progress-wait {
  text-align: center;
  color: #94a3b8;
  font-size: 0.9rem;
  padding: 0.15rem 0;
}
.summary-item .status {
  font-weight: 600;
  margin-top: 0.4rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.summary-item .status svg {
  width: 18px;
  height: 18px;
}
.summary-item .status.gereed svg { color: #22c55e; }
.summary-item .status.gestart svg { color: #60a5fa; animation: pulse 2s infinite ease-in-out; }
.summary-item .status.timeout svg { color: #f59e0b; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

.summary-item .status.gereed { color: #22c55e; }
.summary-item .status.gestart { color: #60a5fa; }
.summary-item .status.timeout { color: #f59e0b; }
.summary-item .lastupdate {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

#feed-container { margin-top: 1.5rem; }
/* Feed scrolldeel binnen de content; vaste max hoogte bij open */
.feed-content { max-height: 400px; }

/* Custom scrollbar styling for the logbook (feed-content) */
/* Firefox */
.feed-content {
  scrollbar-width: thin;
  scrollbar-color: #475569 #1e293b; /* thumb track */
}
/* WebKit (Chrome, Edge, Safari) */
.feed-content::-webkit-scrollbar {
  width: 10px;
}
.feed-content::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 8px;
}
.feed-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #475569, #334155);
  border-radius: 8px;
  border: 2px solid #1e293b;
}
.feed-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #64748b, #475569);
}

.card {
  background: #1e293b;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 0 auto 1rem; /* centreer en houd smaller */
  max-width: 640px;    /* beperk breedte logboekitems */
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.timestamp { font-size: 0.85rem; color: #94a3b8; margin-bottom: 0.25rem; }
.status { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; }
.status.gereed { color: #22c55e; }
.status.gestart { color: #60a5fa; }
.status.timeout { color: #f59e0b; }
.message { font-size: 1.05rem; }

/* Realtime indicator */
#realtime-indicator {
  display: none;
  text-align: center;
  font-size: 0.9rem;
  color: #22c55e;
  margin-bottom: 1.25rem; /* extra ruimte onder de badge */
}
#realtime-indicator .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 6px;
  box-shadow: 0 0 6px rgba(34,197,94,0.45);
  animation: pulseDot 2.4s infinite ease-in-out; /* langzamer, minder glow */
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); box-shadow: 0 0 5px rgba(34,197,94,0.45); }
  50% { transform: scale(1.1); box-shadow: 0 0 10px rgba(34,197,94,0.7); }
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #94a3b8;
  background: #111827;
  border: 1px dashed #334155;
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center; /* centreer de tekst in de kaart */
}
.empty-state > div { text-align: center; }
.empty-state i {
  width: 36px;
  height: 36px;
  color: #f59e0b;
}
.empty-state strong {
  color: #f8fafc;
}
/* Maak de beschrijvingstekst kleiner, behoud kop (strong) zoals hij is */
.empty-state > div:nth-of-type(n+2) {
  font-size: 0.9rem;
}

/* Footer */
#app-footer {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #334155;
  text-align: center;
}
#footer-version {
  color: #94a3b8;
  font-size: 0.85rem;
}

/* Made-with footer regel */
.made-by {
  color: #94a3b8;
  font-size: 0.85rem; /* zelfde grootte als versienummer */
  margin-top: 0.75rem; /* meer afstand van versienummer */
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Lucide vervangt <i data-lucide> door een <svg>; style het SVG direct */
.made-by svg { width: 1em; height: 1em; line-height: 1; display: inline-block; vertical-align: -0.125em; stroke: none !important; fill: #ef4444 !important; }

/* Quote panel */
.quote-panel {
  background: #111827;
  border: 1px dashed #334155;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1.25rem auto 0;
  max-width: 720px;
}
.quote-text {
  color: #e5e7eb;
  font-size: 1rem;
  line-height: 1.5;
  font-style: italic;
  text-align: center;
}
.quote-meta {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  text-align: center;
}
