* { box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, Segoe UI, sans-serif;
  margin: 0;
  background: #f4f5f7;
  color: #1a1a1a;
}
.topnav {
  background: #1f2937;
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav a { color: #d1d5db; text-decoration: none; }
.topnav a:hover { color: #fff; }
.topnav .brand { font-weight: bold; margin-right: 0.5rem; }
.topnav .major-tab {
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  color: #e5e7eb;
}
.topnav .major-tab.active { background: #2563eb; color: #fff; }

/* Hamburger-knappen er kun relevant på mobil (se media query nedenfor) -
   på desktop er hele menuen altid synlig som en almindelig vandret bar. */
.hamburger-btn { display: none; }

.nav-menu {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1.25rem;
  position: static;
  background: none;
  padding: 0;
  box-shadow: none;
  margin-left: 0.5rem;
}
.nav-menu .who { color: #9ca3af; font-size: 0.9em; margin-left: auto; }

/* Mobil: menuen bliver en klassisk hamburger-udfoldet panel i stedet for
   en altid-synlig vandret bar, så den smalle skærm ikke bliver overfyldt. */
@media (max-width: 640px) {
  .hamburger-btn {
    display: block;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4em;
    line-height: 1;
    padding: 0.1rem 0.4rem;
    cursor: pointer;
    margin-left: auto;
  }
  .hamburger-btn:hover { background: rgba(255,255,255,0.1); }

  .nav-menu {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1f2937;
    padding: 1rem 1.5rem 1.25rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    z-index: 99;
    margin-left: 0;
  }
  .nav-menu.open { display: flex; }
  .nav-menu .who { margin-left: 0; }
}
.logout-form { margin: 0; }
.logout-btn {
  background: none;
  border: none;
  color: #d1d5db;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 0.9em;
}
.logout-btn:hover { color: #fff; background: none; }

.content { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }

.back-fab {
  position: fixed;
  top: 4.2rem;
  right: 1rem;
  z-index: 90;
  background: #374151;
  color: #fff;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
}
.back-fab:hover { background: #1f2937; }

.cards { display: flex; gap: 1rem; }
.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  flex: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-align: center;
}
.card h2 { font-size: 2rem; margin: 0; }
.muted { color: #6b7280; }

table { width: 100%; border-collapse: collapse; margin-top: 1rem; background: #fff; }
th, td { border-bottom: 1px solid #e5e7eb; padding: 0.5rem; text-align: left; }
tr.row-link { cursor: pointer; }
tr.row-link:hover { background: #f4f5f7; }

.section-heading { cursor: pointer; user-select: none; scroll-margin-top: 4.5rem; }
.section-heading:hover { color: #2563eb; }
.finish-step-mark { color: #16a34a; }
.checkmark-toggle {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  width: 1.8em;
  height: 1.8em;
  padding: 0;
  font-size: 1.1em;
  line-height: 1;
  cursor: pointer;
  color: #9ca3af;
}
.checkmark-toggle:hover { background: #f4f5f7; border-color: #9ca3af; }
.checkmark-toggle.done { color: #16a34a; border-color: #16a34a; background: #f0fdf4; }
.section-heading-text.done { color: #16a34a; }
.finish-toggle-form { margin-top: 0.75rem; }
.section-count { font-weight: normal; font-size: 0.8em; color: #6b7280; }

.copy-btn {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.8em;
  cursor: pointer;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.copy-btn:hover { background: #e0e7ff; }

form { display: flex; flex-direction: column; gap: 0.75rem; max-width: 420px; margin-top: 1rem; }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9em; }
input, select, textarea { padding: 0.5rem; border: 1px solid #d1d5db; border-radius: 4px; font-size: 16px; }
/* Dato-felter har en indbygget min-bredde i browseren der er mindre end
   andre inputs på siden - stræk dem til fuld bredde af deres label, så
   de passer visuelt ind med resten af formularen. */
input[type="date"] { width: 100%; font-size: 1em; }

.btn, button {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  width: fit-content;
}
.btn:hover, button:hover { background: #1d4ed8; }

.photo-grid { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }
.photo-item { margin: 0; width: 180px; }
.photo-item img { width: 180px; height: 180px; object-fit: cover; border-radius: 6px; display: block; }
.photo-item figcaption { font-size: 0.85em; margin-top: 0.25rem; }

.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.5rem; margin-top: 1rem; }
.flow-card {
  background: #fff;
  border-radius: 8px;
  border: 3px solid #22c55e;
  padding: 0.75rem;
  width: 190px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}
.flow-card:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.15); transform: translateY(-2px); }
.flow-card.due { border-color: #dc2626; }
.flow-card-header { display: flex; flex-direction: column; gap: 0.1rem; }
.flow-count { font-size: 1.3em; font-weight: bold; }
.flow-card-body { font-size: 0.85em; }
.flow-due-badge { background: #fee2e2; color: #991b1b; font-size: 0.8em; padding: 0.2rem 0.4rem; border-radius: 4px; width: fit-content; }
.flow-card-metric { font-size: 0.72em; color: #9ca3af; line-height: 1.3; }
.flow-arrow { display: flex; align-items: center; font-size: 1.5em; color: #9ca3af; }
.flow-branch { display: flex; flex-direction: column; gap: 0.5rem; }

@media (max-width: 700px) {
  .flow { flex-direction: column; }
  .flow-arrow { transform: rotate(90deg); align-self: center; }
  .flow-card { width: 100%; }
  .flow-branch { width: 100%; }
}

@keyframes flash-highlight-fade { from { background: #fef3c7; } to { background: transparent; } }
.flash-highlight { animation: flash-highlight-fade 2s ease-out; }

.due-banner {
  background: #fee2e2;
  border: 1px solid #dc2626;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.due-row { background: #fef2f2; }

.tabs { display: flex; gap: 0.5rem; margin: 1rem 0; border-bottom: 1px solid #e5e7eb; }
.tab {
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: #6b7280;
  border-bottom: 2px solid transparent;
}
.tab.active { color: #2563eb; border-bottom-color: #2563eb; font-weight: bold; }

.header-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.section-header-row { margin-top: 2.25rem; }
.header-row h1, .header-row h2 { margin: 0; }
.header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-forward { background: #16a34a; }
.btn-forward:hover { background: #15803d; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }

.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.confirm-modal {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.confirm-modal-actions { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1rem; }
.btn-manual-time { background: #7c3aed; }
.btn-manual-time:hover { background: #6d28d9; }

/* Mobiltelefon */
@media (max-width: 640px) {
  .content { margin: 1rem auto; padding: 0 0.75rem; }
  .topnav { padding: 0.5rem 0.75rem; }
  table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  form { max-width: 100%; }
  .cards { flex-direction: column; }
  .photo-item { width: 140px; }
  .photo-item img { width: 140px; height: 140px; }
  .header-row { align-items: flex-start; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab { flex-shrink: 0; }
}

/* Offentlig firmaside */
.public-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.public-header-brand { font-weight: bold; font-size: 1.2em; }
.login-pill {
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95em;
  transition: background 0.15s;
}
.login-pill:hover { background: #1d4ed8; }
.welcome-text { font-size: 1.1em; }
.staff-login-link { margin-top: 3rem; font-size: 0.85em; }

/* Login-kort (admin/staff og kunde) */
.login-body { background: #f4f5f7; display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; }
.login-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
  margin: 1rem;
}
.login-card h1 { font-size: 1.4em; margin: 0.25rem 0 0.5rem; }
.login-icon { font-size: 2.5em; }
.login-card form { margin: 1.25rem auto 0.5rem; text-align: left; }
.login-card label { font-size: 0.9em; }

.autocomplete-results {
  display: none;
  position: relative;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  margin-top: -0.5rem;
  max-height: 260px;
  overflow-y: auto;
  z-index: 10;
}
.autocomplete-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.9em;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: #f4f5f7; }

#toast-container {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  z-index: 1100;
  pointer-events: none;
}
.toast {
  background: #16a34a;
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9em;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}
.toast.show { opacity: 1; transform: translateY(0); }

.delete-x-btn {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  padding: 0.15rem 0.45rem;
  line-height: 1;
  border-radius: 4px;
}
.delete-x-btn:hover { background: #fee2e2; }

.qty-stepper { display: flex; align-items: center; gap: 0.35rem; }
.qty-btn {
  width: 1.9em;
  height: 1.9em;
  padding: 0;
  line-height: 1;
  font-size: 1.1em;
  border-radius: 4px;
}
.qty-stepper input[type="number"] {
  width: 3.5em;
  text-align: center;
}
