
/* Generelt */
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f1f5f9;
  color: #1f2937;
}

/* Admin header */
.admin-header {
  background: #064e3b;
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  margin: 0;
}

/* Admin main */
.admin-main {
  max-width: 900px;
  margin: 1rem auto;
  padding: 0 1rem;
}

/* Kort */
.card {
  background: white;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

/* Login */
#loginBox {
  max-width: 320px;
  margin: 4rem auto;
  background: white;
  padding: 1.5rem;
  border-radius: 6px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

#loginBox input {
  width: 100%;
  margin-bottom: 0.8rem;
  padding: 0.5rem;
}

button {
  background: #064e3b;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background: #047857;
}

ul {
  list-style: none;
  padding: 0;
}

li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}

/* =============================/*   ============================= */

/* Kalender-header (måned + piler) */
.calendar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.calendar-header h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  text-transform: capitalize;
}

.calendar-header button {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #064e3b;
  color: white;
}

.calendar-header button:hover {
  background: #047857;
}

/* Selve kalender-gridet */
.admin-main #calendar.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #d1d5db;
}

/* Dagcelle */
.admin-main #calendar .calendar-day {
  background: #ffffff;
  min-height: 120px;
  padding: 6px;
  box-sizing: border-box;
  font-size: 0.85rem;
  position: relative;
}

.admin-main #calendar .calendar-day:hover {
  background: #f9fafb;
}

/* Dagsnummer */
.admin-main #calendar .calendar-day > header {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #1f2937;
}

/* Booking / forespørsel */
.admin-main #calendar .booking {
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 4px;
  margin-top: 4px;
  cursor: pointer;
  line-height: 1.2;
  white-space: normal;
}

/* Statusfarger (matcher JS: status-${status}) */
.admin-main #calendar .status-booket {
  background: #dcfce7;
  color: #14532d;
}

.admin-main #calendar .status-besvart {
  background: #fde68a;
  color: #78350f;
}

.admin-main #calendar .status-ny {
  background: #fee2e2;
  color: #7f1d1d;
}

.admin-main #calendar .status-gjennomført {
  background: #e5e7eb;
  color: #374151;
}

/* Hover på booking */
.admin-main #calendar .booking:hover {
  opacity: 0.9;
}

/* (Valgfritt) Marker i dag – hvis JS legger klassen .today */
.admin-main #calendar .calendar-day.today {
  outline: 2px solid #064e3b;
  outline-offset: -2px;
}

/* (Valgfritt) Helger – hvis JS legger .weekend */
.admin-main #calendar .calendar-day.weekend {
  background: #f3f4f6;
}


/* Forespørsel */
.booking.request {
  background: #60a5fa; /* blå */
}

/* Booking */
.booking.booked {
  background: #16a34a; /* grønn */
}

/* Hover */
.booking:hover {
  opacity: 0.9;
}

/* === Admin navigasjon === */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #064e3b;
}

.admin-nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.admin-nav a:hover {
  text-decoration: underline;
}

.admin-nav-right {
  margin-left: auto;
  color: #d1fae5;
  font-size: 0.85rem;
}

/* === Badge for nye forespørsler === */
.badge {
  background: #dc2626; /* rød */
  color: white;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.7rem;
  margin-left: 4px;
  vertical-align: top;
}

button.warning {
  background: #f59e0b;
  color: white;
}

.filter-bar {
  margin-bottom: 1rem;
}

.filter-bar label {
  font-weight: 500;
  margin-right: 0.5rem;
}

.filter-bar select {
  padding: 0.3rem;
}

/* === Statusfarger på forespørsler === */
.card.status-ny {
  border-left: 4px solid #2563eb; /* blå */
}

.card.status-besvart {
  border-left: 4px solid #f59e0b; /* gul */
}

.card.status-booket {
  border-left: 4px solid #16a34a; /* grønn */
}

.card.status-gjennomført {
  border-left: 4px solid #6b7280; /* grå */
  opacity: 0.85;
}

.card.status-arkivert {
  border-left: 4px solid #9ca3af;
  opacity: 0.65;
}

/* === Maskinbeskrivelse i admin === */
.card textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
}

.save-status {
  font-size: 0.85rem;
  color: #16a34a;
  margin: 0.25rem 0;
}

.save-status.saved {
  font-weight: 500;
}

.card img {
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.machine-card-grid {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 1rem;
  align-items: start;
}

.machine-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.machine-thumb-placeholder {
  width: 100%;
  height: 120px;
  background: #f3f4f6;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.machine-card-right input[type="file"] {
  font-size: 0.75rem;
}

.card img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.card .price {
  margin: 0.25rem 0;
  font-size: 1rem;
}

.card .desc {
  font-size: 0.9rem;
  color: #374151;
}

.request-toggle summary {
  cursor: pointer;
  margin: 0.5rem 0;
  font-weight: 500;
}

.request-toggle[open] summary {
  margin-bottom: 0.25rem;
}

.availability {
  font-weight: 500;
  margin: 0.5rem 0;
}

.availability.free {
  color: #16a34a;
}

.availability.pending {
  color: #ca8a04;
}

.availability.busy {
  color: #b91c1c;
}

.request-note {
  margin: 0.5rem 0;
  color: #374151;
  font-size: 0.85rem;
}


.request-feedback {
  border: 1px solid #d1fae5;
  background: #ecfdf5;
  color: #065f46;
  padding: 0.75rem;
  border-radius: 8px;
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.next-available {
  margin: 0.4rem 0;
  font-size: 0.9rem;
  color: #1f2937;
}


button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.request-submit:disabled {
  pointer-events: none;
}

.date-error {
  color: #b91c1c;
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

.request-form {
  margin-top: 0.75rem;
}

.request-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
}

.request-form input,
.request-form textarea {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box; /* ✅ forhindrer små layout-glipp */
}


.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: 1.5rem;
  column-gap: 2rem;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  inline-size: 100%;
  box-sizing: border-box;
}

.request-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.55rem;
  font-size: 0.9rem;
  border-radius: 6px;
}

.request-note {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0.4rem 0;
}

.date-error {
  color: #b91c1c;
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

.request-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem; /* ✅ gir luft mellom feltene */
}

.availability-inline {
  margin-bottom: 0.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #f9fafb;
}






.booking {
  font-size: 0.75rem;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  margin-top: 0.15rem;
}

/* Statusfarger */
.status-booket {
  background: #fecaca;
  color: #7f1d1d;
}

.status-besvart {
  background: #fef9c3;
  color: #854d0e;
}

.status-ny {
  background: #e0f2fe;
  color: #075985;
}

.status-gjennomført {
  background: #dcfce7;
  color: #14532d;
}



/* Valgfri styling */
.btn-secondary {
  padding: 0.4rem 0.75rem;
  border: none;
  background: #e5e7eb;
  border-radius: 4px;
  cursor: pointer;
}


/* BODY */
#modalBody > * {
  margin-bottom: 0.4rem;
}


/* ❗IKKE gjør knapper inaktive her */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================= */
/* MODAL – ADMIN KALENDER        */
/* ============================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Modal skjules KUN med denne */
.modal.hidden {
  display: none;
}

/* Selve boksen */
.modal-content {
  background: #ffffff;
  padding: 1rem;
  border-radius: 8px;
  min-width: 320px;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Innhold i body */
#modalBody > * {
  margin-bottom: 0.4rem;
}

#modalBody hr {
  margin: 0.6rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

/* Footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Knapper */
.btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #e5e7eb;
  color: #111827;
  border: none;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-secondary:hover {
  background: #d1d5db;
}

/* ============================= */
/* ADMIN – MASKINER              */
/* ============================= */

/* Kortet */
.card {
  background: #ffffff;
  padding: 1rem;
  margin-bottom: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* Bilde øverst på kortet */
.machine-image-header {
  margin-bottom: 0.75rem;
}

.machine-image-header img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

/* Grid for innhold */
.machine-card-grid {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 1rem;
  align-items: start;
}

/* Venstre kolonne */
.machine-card-left label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}

.machine-card-left input,
.machine-card-left textarea {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
}

/* Beskrivelse */
.machine-card-left textarea {
  min-height: 90px;
  resize: vertical;
}

/* Seksjonsoverskrifter */
.machine-card-left h4 {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.85rem;
  color: #064e3b;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.2rem;
}

/* Lagre-status */
.save-status {
  font-size: 0.8rem;
  margin: 0.3rem 0;
}

.save-status.saved {
  color: #16a34a;
  font-weight: 600;
}

/* Knapper */
.machine-card-left button {
  margin-right: 0.4rem;
  margin-top: 0.5rem;
}

/* Høyre kolonne */
.machine-card-right {
  font-size: 0.75rem;
}

/* Forhåndsvisning av bilde */
.machine-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  margin-bottom: 0.4rem;
}

/* Fil-input */
.machine-card-right input[type="file"] {
  width: 100%;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Mobil */
@media (max-width: 700px) {
  .machine-card-grid {
    grid-template-columns: 1fr;
  }

  .machine-image-header img {
    max-height: 180px;
  }
}

.last-updated { 
font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.15rem;
}

.machine-status {
  font-size: 0.8rem;
  margin: 0.35rem 0;
  font-weight: 500;
}

.status-available { color: #16a34a; }
.status-service   { color: #ca8a04; }
.status-hidden    { color: #6b7280; }

/* ============================= */
/* ADMIN – FORESØRSELSKORT       */
/* ============================= */

.request-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.machine-title {
  font-size: 1rem;
  font-weight: 600;
}

/* Status badge */
.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.badge-ny { background:#dbeafe;color:#1d4ed8; }
.badge-besvart { background:#fef3c7;color:#92400e; }
.badge-booket { background:#dcfce7;color:#166534; }
.badge-gjennomført { background:#e5e7eb;color:#374151; }
.badge-arkivert { background:#fee2e2;color:#991b1b; }
.badge-tilbud_sendt {
  background: #1976d2;
  color: white;
}

.badge-signert {
  background: #2e7d32;
  color: white;
}
/* Seksjoner */
.request-section {
  margin: 0.4rem 0;
}

.request-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.1rem;
}

.request-value {
  font-size: 0.85rem;
}

.muted {
  color: #6b7280;
  font-size: 0.8rem;
}

/* Handlinger */
.request-actions {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.request-actions button,
.request-actions select {
  font-size: 0.75rem;
}

/* Knappetyper */
.success { background:#16a34a; }
.primary { background:#2563eb; }
.warning { background:#f59e0b;color:#000; }
.muted-btn { background:#6b7280; }
.danger-soft { background:#9ca3af; }
.danger { background:#991b1b; }


.small-btn {
  font-size: 0.7rem;
  padding: 0.25rem 0.45rem;
}

.admin-note {
  width: 100%;
  min-height: 50px;
  font-size: 0.8rem;
  padding: 0.4rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  resize: vertical;
}

.note-saved {
  font-size: 0.7rem;
  color: #16a34a;
  margin-left: 0.25rem;
}

.option-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.4rem;
}



.option-group {
  border-left: 3px solid #e5e7eb;
  padding-left: 0.75rem;
  margin: 0.5rem 0 0.75rem;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* ================================
   Kundeside – maskinstatus
================================ */

.machine-status .alert {
  background-color: #f8f9fa; /* fallback */
  padding: 0.6rem 0.9rem;   /*endre høyde på boksen*/
  border-radius: 6px;
  margin-bottom: 0.75rem;
  border-left: 5px solid transparent;
}

/* ✅ Ledig */
.machine-status .alert-success {
  background-color: #e8f5e9;
  border-left-color: #2e7d32;
  color: #1b5e20;
}

/* 🟡 Etterspurt */
.machine-status .alert-warning {
  background-color: #fff8e1;
  border-left-color: #f9a825;
  color: #795548;
}

/* 🔴 Opptatt */
.machine-status .alert-danger {
  background-color: #fdecea;
  border-left-color: #c62828;
  color: #7f1d1d;
}

.machine-image {
  transition: transform 0.2s ease;
}

.machine-image:hover {
  transform: scale(1.01);
}


/* Forklaringstekst under status */
.machine-status small {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85em;
  opacity: 0.85;
}


#machineFormWrapper {
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem;
}

#machineFormWrapper .admin-card {
  width: 100%;
  max-width: 1100px;

  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  border: 1px solid #e5e7eb;
}

.admin-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.admin-card-content {
  padding: 1.5rem;
}

.admin-row {
  display: grid;
  grid-template-columns: 48px 1fr 180px 120px 40px;
  align-items: center;
  gap: 0.9rem;

  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;

  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;

  box-shadow: 0 1px 2px rgba(0,0,0,0.03);

  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease,
    transform 0.12s ease;
}

.admin-row:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.admin-row-thumb img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.admin-row-name {
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-row-name:hover {
  text-decoration: underline;
}

.admin-row-type {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 2px;
}

.admin-row-status select {
  width: 100%;
  height: 32px;

  padding: 0 0.6rem;
  font-size: 0.85rem;

  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;

  color: #374151;
  cursor: pointer;

  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%);
  background-position:
    calc(100% - 14px) 13px,
    calc(100% - 9px) 13px;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}


.admin-row-status select:hover,
.admin-row-status select:focus {
  background-color: #ffffff;
  border-color: #cbd5e1;
  outline: none;
}


.admin-row-active input {
  transform: scale(1.1);
  cursor: pointer;
}

.admin-row-open button {
  font-size: 1.3rem;
  color: #9ca3af;
}

.admin-row-open button:hover {
  color: #111827;
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  gap: 0.4rem;
}

.toggle input {
  display: none;
}

.toggle-slider {
  width: 42px;
  height: 22px;
  background: #d1d5db;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
}

.toggle-slider::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 2px;
  left: 2px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: #16a34a;
}

.toggle input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

.toggle-text {
  font-size: 0.85rem;
  color: #374151;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;

  font-size: 0.8rem;
  font-weight: 500;

  cursor: pointer;
  user-select: none;

  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.status-ok {
  background-color: #ecfdf5;
  color: #065f46;
}

.status-down {
  background-color: #fff7ed;
  color: #9a3412;
}

.status-badge:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.machine-section {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;

  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}


.machine-section h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: #111827;
}

.machine-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #374151;
}



.machine-footer {
  position: sticky;
  bottom: 0;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 0.8rem 1.2rem;

  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.machine-section input,
.machine-section textarea,
.machine-section select {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  margin-top: 0.25rem;

  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  width: 100%;
}

.machine-section input:focus,
.machine-section textarea:focus,
.machine-section select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}


  
.machine-section select#status {
  max-width: 220px;
}

.machine-section select#status {
  margin-top: 0.2rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.henger-prices {
  margin-left: 1.5rem;
}



/* ⛔️ Overstyr feil layout på kompatible hengere */
#compatibleHengersList .option-item {
  display: flex;
  align-items: center;
  justify-content: flex-start !important; /* 🔥 viktig */
  gap: 0.5rem;

  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.6rem;

  cursor: pointer;
}

/* Lås checkboxen */
#compatibleHengersList .option-item input {
  margin: 0;
  flex-shrink: 0;
}

#compatibleHengersList .toggle {
  justify-content: space-between;
}

#compatibleHengersList .toggle-text {
  margin-left: 0.6rem;
}

.btn-read-more {
  display: inline-block;
  background: #16a34a;         /* grønn */
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;        /* pill‑knapp */
  text-decoration: none;
  transition:
    background-color 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.btn-read-more:hover {
  background: #15803d;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.btn-read-more:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* ============================= */
/* Kunde – Maskin detaljside     */
/* ============================= */

.machine-detail-card {
  max-width: 820px;
  margin: 0 auto;
}

.machine-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.machine-lead {
  font-size: 1rem;
  color: #374151;
  margin-bottom: 1rem;
}

.machine-section {
  margin-top: 1.2rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
}

.machine-section h3 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

/* Teknisk liste */
.tech-list,
.accessory-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tech-list li,
.accessory-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.9rem;
}

/* Priser */
.price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.price-grid > div {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.6rem;
  text-align: center;
}

.price-label {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
}

.price-value {
  font-size: 1rem;
  font-weight: 600;
}

/* Gjenbruk grønn knapp */
.card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* ============================= */
/* Kunde – Bildegalleri          */
/* ============================= */

.image-gallery {
  margin-bottom: 1rem;
}

.gallery-main {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.gallery-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.7;
}

.gallery-thumb:hover {
  opacity: 1;
}

.gallery-thumb.active {
  border-color: #16a34a;
  opacity: 1;
}

/* ============================= */
/* ADMIN – Bildegalleri (FINAL)  */
/* ============================= */

/* Én rad per bilde */
.admin-gallery-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
}

/* Venstre: bilde */
.admin-gallery-image {
  position: relative;
  width: 120px;
  flex-shrink: 0;
}

.admin-gallery-image img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
}

/* Hovedbilde‑badge */
.admin-gallery-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #16a34a;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 999px;
}

/* Høyre: tekst + actions */
.admin-gallery-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Tekstfelt */

.admin-image-caption {
  width: 100%;
  min-height: 3.6em;           /* tilsvarer ca. 3 linjer */
  padding: 6px 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  resize: vertical;            /* valgfritt: la admin justere litt */
  box-sizing: border-box;
}

/* Viktig: ingen størrelseendring på focus */
.admin-image-caption:focus {
  outline: none;
  border-color: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}


/* Knapper */
.admin-gallery-actions {
  display: flex;
  gap: 6px;
}

/* Valgfritt: marker hovedbilde‑raden */
.admin-gallery-row.main {
  outline: 2px solid #16a34a;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.lightbox.visible {
  display: flex;
}

.lightbox-figure {
  max-width: 90%;
  max-height: 90%;
  text-align: center;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 10px;
}

#adminLightboxCaption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #e5e7eb;
  line-height: 1.4;
}

.gallery-thumb-wrapper {
  text-align: center;
}

.gallery-thumb-wrapper figcaption {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.2;
}

.admin-image-caption {
  width: 100%;
  margin-top: 4px;
  padding: 4px 6px;
  font-size: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  box-sizing: border-box;
}

.lightbox-figure {
  text-align: center;
  max-width: 90%;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 10px;
}

#customerLightboxCaption {
  margin-top: 12px;
  font-size: 0.95rem;
  color: #e5e7eb;
  line-height: 1.4;
}



/* Normal tilstand */
input,
select,
textarea {
  border: 1px solid #d1d5db;
}

/* Fokus – IKKE endre størrelse */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6; /* blå fokus */
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
}

.btn-danger {
  background: #dc2626;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.btn-danger:hover {
  background: #b91c1c;
}

/* Standard label for radio/checkbox-lister */
.option-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin: 0.25rem 0;
}

/* ============================
   REQUESTS-KORT=========== */

.request-card .request-select {
  width: 100%;
  height: 38px;
  padding: 0 2.25rem 0 0.75rem;

  font-size: 0.95rem;
  font-family: inherit;
  color: #1f2937;

  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: #ffffff;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  box-sizing: border-box;
  cursor: pointer;
}

/* Fokus – diskret, ikke admin-blå */
.request-card .request-select:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

/* Dropdown-pil */
.request-card {
  position: relative;
}

.request-card .request-select {
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 13px) calc(50% - 3px);
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

.service-plan-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  padding: 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: #ffffff;
}

.service-plan-meta {
  font-size: 0.8rem;
  color: #6b7280;
}

.service-plan-actions button {
  font-size: 0.75rem;
}

/* ============================= */
/* ADMIN – SERVICEPLAN MODAL     */
/* ============================= */

#servicePlanModal .modal-content {
  max-width: 620px;
  width: 100%;
}

/* Selve skjema-layouten */
#servicePlanForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1.2rem;
  align-items: start;
}

/* Alle labels i modalen */
#servicePlanForm label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
}

/* Input / select / textarea */
#servicePlanForm input,
#servicePlanForm select,
#servicePlanForm textarea {
  margin-top: 0.3rem;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;

  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
  width: 100%;
}

/* Beskrivelse = full bredde */
#servicePlanForm textarea {
  grid-column: span 2;
  min-height: 90px;
  resize: vertical;
}

/* Checkbox på egen rad */
#servicePlanForm .checkbox-label {
  grid-column: span 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  margin-top: 0.2rem;
}

/* Footer (Lagre / Avbryt) */
#servicePlanForm .modal-footer {
  grid-column: span 2;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;

  margin-top: 0.9rem;
  padding-top: 0.6rem;
  border-top: 1px solid #e5e7eb;
}
#servicePlanModal h3 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.service-plan-row.inactive {
  opacity: 0.4 !important;
  background: #f3f4f6 !important;
}

.machine-usage.editable {
  cursor: pointer;
}

.machine-usage.editable:hover {
  background: #e5e7eb;
}

.service-history-item {
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.85rem;
}

.service-history-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.service-history-meta {
  color: #6b7280;
  margin-top: 0.2rem;
}

.service-history-actions {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.5rem;
}

.service-plan-status {
  font-weight: 600;
  font-size: 0.85rem;
}

.status-ok {
  color: #15803d; /* grønn */
}

.status-warning {
  color: #ca8a04; /* gul */
}

.status-danger {
  color: #dc2626; /* rød */
}

.status-inactive {
  color: #6b7280; /* grå */
}

/* Historikk er lesemodus som default */
.service-history-actions {
  display: none;
}

/* Når redigeringsmodus er aktiv */
.edit-history-mode .service-history-actions {
  display: flex;
}

.edit-history-mode .service-history-item {
  background: #f9fafb;
  border-left: 3px solid #d1d5db;
}

/* Header layout */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.service-history-meta {
  font-size: 0.85rem;
  color: #4b5563;
}

.service-plan-next {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.2rem;
}
/* =============================
   MASKIN-FANER
   ============================= */

.machine-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1rem;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  font-weight: 500;
  color: #374151;
  border-bottom: 3px solid transparent;
}

.tab-btn.active {
  border-bottom-color: #065f46;
  color: #065f46;
}

/* 🔴 VIKTIGSTE LINJENE */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.overview-card {
  border: 1px solid #e5e7eb;
  padding: 1rem;
  border-radius: 6px;
  background: #f9fafb;
}

.overview-status,
.overview-next {
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem;
}

/* =========================
   SERVICELOGG MODAL
   ========================= */

#serviceLogModal .modal-content {
  max-width: 520px;
  padding: 1.5rem;
}

#serviceLogForm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Labels alltid over input */
#serviceLogForm label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  font-weight: 500;
  color: #374151;
}

/* Inputs og textarea – lik stil */
#serviceLogForm input,
#serviceLogForm textarea {
  margin-top: 0.3rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

/* Beskrivelse over full bredde */
#serviceLogForm textarea {
  grid-column: span 2;
  min-height: 80px;
  resize: vertical;
}

/* Modal footer under skjema */
#serviceLogForm .modal-footer {
  grid-column: span 2;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.overview-service-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.overview-actions {
  text-align: right;
}

.overview-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

/* Knappen under kortene */
.overview-actions {
  margin-top: 0.75rem;
  text-align: right;
}

/* =========================
   VEDLIKEHOLD – TABELL
   ========================= */

.maintenance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.maintenance-table thead th {
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e5e7eb;
  padding: 0.6rem 0.5rem;
}

.maintenance-table tbody td {
  padding: 0.55rem 0.5rem;
}
.admin-subnav {
  margin: 0.5rem 0 1rem;
}

.filter-tab {
  position: relative;
}

.filter-count {
  margin-left: 4px;
  font-weight: 600;
  font-size: 0.8em;
  opacity: 0.8;
}


/* Venstre del (menypunkter) */
.admin-nav-left {
  display: flex;
  gap: 1.4rem;
}

.admin-nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding-bottom: 2px;
}

/* Aktiv side */
.admin-nav a.active {
  font-weight: 600;
  border-bottom: 2px solid #ffffff;
}

/* Hover */
.admin-nav a:hover {
  opacity: 0.85;
}

/* Høyre del (admin + logout) */
.admin-nav-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.admin-user {
  font-size: 0.85rem;
  opacity: 0.9;
}

.admin-nav-right button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}

.admin-nav-right button:hover {
  background: rgba(255,255,255,0.15);
}

/* =========================
   SIDEHEADER (TITTELFELT)
   ========================= */

.admin-header {
  background-color: #0f4d3c;
  color: white;
  padding: 1.2rem 1.4rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-header h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 600;
}


.admin-nav {
  display: flex;
}

.service-interval {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem;
}

.service-interval legend {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0 0.25rem;
}

.service-interval .radio-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.service-interval input[type="number"] {
  width: 100%;
}

/* === MODAL BACKDROP === *//* === MODAL: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Skjult */
.modal.hidden {
  display: none;
}

/* === MODAL CONTENT === */
.modal-content {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 420px;
  padding: 20px 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  animation: modalFadeIn 0.15s ease-out;
}

/* === HEADER === */
.modal-content h3 {
  margin: 0 0 16px 0;
  font-size: 1.2rem;
}

/* === FORM FIELDS === */
.modal-content label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.modal-content textarea {
  resize: vertical;
}

/* === ACTIONS === */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions button {
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Primærknapp */
.modal-actions .primary {
  background: #f39c12;
  border: none;
  color: #000;
  border-radius: 4px;
}

/* === ANIMASJON === */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* === REPARASJON I HISTORIKK === */
.service-history-item.repair {
  border-left: 4px solid #f39c12;
  background-color: #fff9f0;
}

.modal {
  position: fixed;
}

.overview-total {
  margin-top: 14px;
  padding: 14px 16px;
  background: #f9fafb;
  border-radius: 8px;
}

.total-title {
  font-size: 0.9rem;
  color: #374151;
}

.total-amount {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 4px;
}

.total-amount .currency {
  font-size: 0.9rem;
  font-weight: 500;
  margin-left: 2px;
}

.total-meta {
  font-size: 0.8rem;
  margin-top: 4px;
}

/* Filter skal være kontekst, ikke fokus */
.overview-filter {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 8px;
}

/* Rep / service */
.cost-block {
  margin-bottom: 10px;
}

.cost-title {
  font-size: 0.9rem;
  color: #374151;
}

.cost-amount {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.1;
}

.cost-meta {
  font-size: 0.8rem;
  color: #6b7280;
}

/* TOTAL – egen visuell identitet */
.overview-total {
  margin-top: 14px;
  padding: 14px 16px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 8px;
}

.total-title {
  font-size: 0.9rem;
  color: #374151;
}

.total-amount {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 4px;
}

.total-amount .currency {
  font-size: 0.9rem;
  font-weight: 500;
}

.total-meta {
  font-size: 0.8rem;
  margin-top: 4px;
  color: #6b7280;
}

/* =========================
   OVERORDNET WRAPPER
   ========================= */

.overview-economy {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 1rem;
}


/* =========================
   PERIODEVELGER
   ========================= */

.overview-period {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.overview-period select {
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}


/* =========================
   FELLES BLOKK-STIL
   ========================= */

.economy-block {
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: #fff;
}

.block-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.block-icon {
  font-size: 1.1rem;
}

.block-title {
  font-weight: 600;
  font-size: 0.95rem;
}


/* =========================
   VERDI / TALL
   ========================= */

.block-value {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.currency {
  font-size: 0.95rem;
  font-weight: 500;
  margin-left: 0.15rem;
  opacity: 0.85;
}


/* =========================
   INNTEKT
   ========================= */

 الاقتصاد-income {
  border-left: 4px solid #3ba175;
}

.economy-income .block-value {
  color: #0f5132;
}


/* =========================
   KOSTNADER
   ========================= */

.economy-costs {
  border-left: 4px solid #d97706;
}

.cost-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1rem;
  padding: 0.4rem 0;
}

.cost-label {
  font-weight: 600;
}

.cost-meta {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  opacity: 0.75;
}

.cost-amount {
  font-weight: 600;
  text-align: right;
}

.cost-total {
  display: flex;
  justify-content: space-between;
  border-top: 1px dashed #ccc;
  margin-top: 0.6rem;
  padding-top: 0.4rem;
  font-weight: 700;
}


/* =========================
   RESULTAT / FORTJENESTE
   ========================= */

.economy-result {
  border-width: 2px;
}

.economy-result .block-value {
  font-size: 1.9rem;
  margin-top: 0.4rem;
}

.economy-result .block-meta {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  opacity: 0.7;
}


/* POSITIV / NEGATIV TILSTAND */

.economy-result.positive {
  border-color: #198754;
  background: #f1fbf5;
}

.economy-result.positive .block-value {
  color: #198754;
}

.economy-result.negative {
  border-color: #dc3545;
  background: #fff5f5;
}

.economy-result.negative .block-value {
  color: #dc3545;
}

.mva-breakdown {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.15rem;
  line-height: 1.2;
}

.filter-bar {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem 0.75rem;
  background: #f5f5f5;
  border-radius: 6px;
  align-items: center;
}

.filter-bar label {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.9rem;
  cursor: pointer;
}

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.6rem;
}

.card strong {
  font-size: 1rem;
}

.damage-open {
  color: #b00020;
  font-weight: 600;
}

.damage-closed {
  color: #2e7d32;
  font-weight: 600;
}

.machine-link {
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
}

.machine-link:hover {
  text-decoration: underline;
}

.damage-open {
  color: #b00020;
  font-weight: 600;
}

.damage-closed {
  color: #2e7d32;
  font-weight: 600;
}

.small {
  font-size: 0.8rem;
}

.damage-photos {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.damage-photo-thumb {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ccc;
  cursor: pointer;
}

.damage-photo-wrapper {
  position: relative;
  display: inline-block;
}

.damage-photo-delete {
  position: absolute;
  top: -6px;
  right: -6px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

.damage-photo-delete:hover {
  background: #b00020;
}
.damage-photo-wrapper {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
}

.damage-photo-actions {
  text-align: center;
}

.damage-photo-delete-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  color: #b00020;
  cursor: pointer;
  text-decoration: underline;
}

.damage-photo-delete-link:hover {
  color: #7a0000;
}

.img-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.img-modal img {
  max-width: 95%;
  max-height: 95%;
}

.img-modal.hidden {
  display: none;
}

.upload-progress {
  margin-top: 0.5rem;
  height: 6px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.upload-progress.hidden {
  display: none;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: #1976d2;
  transition: width 0.1s linear;
}

.history-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #ddd;
}

.history-tab {
  background: none;
  border: none;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  color: #555;
}

.history-tab.active {
  font-weight: 600;
  color: #0b5c3f;
  border-bottom-color: #0b5c3f;
}

.history-panel {
  display: none;
}

.history-panel.active {
  display: block;
}

.rental-history-list {
  display: grid;
  gap: 0.5rem;
}

.rental-row {
  display: grid;
  grid-template-columns: 120px 1fr 120px 120px;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #eee;
  font-size: 0.85rem;
  align-items: center;
}

.rental-status-ok {
  color: #2e7d32;
  font-weight: 600;
}

.rental-status-warn {
  color: #b00020;
  font-weight: 600;
}

.rental-meta {
  font-size: 0.75rem;
  color: #666;
}

.damage-history-list {
  display: grid;
  gap: 0.5rem;
}

.damage-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #eee;
}

.damage-row > div:nth-child(1) { width: 110px; } /* dato */
.damage-row > div:nth-child(3) { width: 120px; } /* kostnad */
.damage-row > div:nth-child(4) { width: 110px; } /* belastning */
.damage-row > div:nth-child(5) { width: 90px; }  /* status */
.damage-row > div:nth-child(6) { width: 70px; }  /* lenke */

.damage-row > div:nth-child(2) { flex: 1; }      /* skade (tekst) */

.damage-open {
  color: #b00020;
  font-weight: 600;
}

.damage-closed {
  color: #2e7d32;
  font-weight: 600;
}

.damage-meta {
  font-size: 0.75rem;
  color: #666;
}

.repair-history-list {
  display: grid;
  gap: 0.5rem;
}

.repair-row {
  display: flex; /* vi holder oss til flex for stabilitet */
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #eee;
}

.repair-row > div:nth-child(1) { width: 110px; } /* dato */
.repair-row > div:nth-child(3) { width: 1fr; }   /* kostnad */
.repair-row > div:nth-child(4) { width: 100px; } /* skade */

.repair-row > div:nth-child(2) {
  flex: 1; /* tittel/beskrivelse */
}

.repair-meta {
  font-size: 0.75rem;
  color: #666;
}

.danger-zone {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px dashed #d32f2f;
}

.danger-zone .btn-danger {
  margin-top: 0.5rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 0.75rem 0;
  margin-bottom: 1rem;

  /* subtil separasjon – IKKE ekstra linje */
  background-color: #eef7f3; /* lys grønn tone */
  box-shadow: inset 0 -1px 0 rgba(11, 77, 58, 0.25);
}


.page-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 600;
}



.page-header-actions {
  display: flex;
  gap: 0.5rem;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
}


.page-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #4f6f65;
}

.settings-tabs {
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 1.25rem 0;
  border-bottom: 1px solid #d8e5df;
  margin-bottom: 1.5rem;
}

.settings-tabs .tab-btn {
  background: none;
  border: none;
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: #758f85;
  cursor: pointer;
}

.settings-tabs .tab-btn.active {
  color: #0b4d3a;
  font-weight: 600;
  border-bottom: 2px solid #0b4d3a;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.4rem;
}

.admin-table th {
  text-align: left;
  font-size: 0.85rem;
  color: #4f6f65;
  padding-bottom: 0.25rem;
}

.admin-table td {
  background: #fff;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
}

.admin-table tr:hover td {
  background: #f4faf7;
}

.icon-btn {
  background: #eef3f1;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
}

.icon-btn:hover {
  background: #dde8e4;
}
.modal-content h3 {
  font-size: 1.3rem;  margin-top: 0;
  font-weight: 600;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}


/* === TOGGLE WRAPPER === */
.toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

/* === SKJUL CHECKBOX === */
.toggle input {
  position: absolute;
  opacity: 0;
}

/* === SLIDER TRACK (DET SOM MANGLER HOS DEG) === */
.toggle-slider {
  display: inline-block;          /* ← VIKTIG */
  position: relative;
  width: 44px;
  height: 24px;

  background-color: #cfd8d5;      /* ← Tydelig spor */
  border-radius: 999px;

  transition: background-color 0.2s ease;
}

/* === THUMB === */
.toggle-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;

  width: 18px;
  height: 18px;

  background-color: #ffffff;
  border-radius: 50%;

  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

/* === AKTIV TILSTAND === */
.toggle input:checked + .toggle-slider {
  background-color: #0b4d3a;      /* Granly-grønn */
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* === LABEL TXT === */
.toggle-text {
  font-size: 0.9rem;
  color: #2f4f46;
}

.maintenance-summary {
  margin-left: 6px;
  display: inline-flex;
  gap: 4px;
}

.todo-alert {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 12px;
  font-weight: 600;
}

.todo-alert.danger {
  background: #e74c3c;
  color: #fff;
}

.todo-alert.warning {
  background: #f1c40f;
  color: #000;
}

.todo-due {
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.todo-due.muted {
  color: #666;
}

.todo-due.warning {
  color: #b26a00;
  font-weight: 600;
}

.todo-due.danger {
  color: #c62828;
  font-weight: 700;
}

a.small-btn {
  text-decoration: none;
  color: inherit;
}

.todo-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* små ikonknapper */
.icon-btn {
  padding: 4px 8px;
  min-width: unset;
  line-height: 1;
}

/* slett (rød) */
.icon-btn.danger {
  background: #c62828;
  color: white;
}

.icon-btn.danger:hover {
  background: #b71c1c;
}

.todo-item {
  display: inline-flex;          /* 🔥 CRITICAL */
  align-items: center;
  gap: 6px;
}


.todo-item span {
  white-space: nowrap;    /* ✅ hindrer linjebrudd */
}

.todo-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;

  padding: 0.9rem;
  margin-bottom: 0.8rem;

  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: 0.15s;
}

.todo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.request-header {
  background: #f5f5f5;
  padding: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.request-body {
  padding: 0.7rem;
}

.hidden {
  display: none;
}

.request-header.compact {
  display: flex;
  align-items: center;
  gap: 0.6rem;

  padding: 0.6rem 0.8rem;
  background: #f5f5f5;
  cursor: pointer;
}

.machine-title {
  font-weight: 600;
  flex: 1; /* viktig: gir maskin mest plass */
}

.req-name {
  white-space: nowrap;
  color: #333;
}

.req-date {
  white-space: nowrap;
  color: #555;
  font-size: 0.85rem;
}

.status-badge {
  margin-left: auto;
}

.todo-alert {
  margin-left: 4px;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 10px;
}

.todo-alert.danger {
  background: #e03131;
  color: white;
}

.todo-alert.warning {
  background: #f08c00;
  color: white;
}

.dashboard-top {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.kpi {
  text-align: center;
  font-size: 1.5rem;
  padding: 1rem;
}

.list-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.clickable {
  cursor: pointer;
  text-decoration: underline;
}

.clickable:hover {
  color: #0a7cff;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.95rem;
}

.filter-item input {
  margin-right: 0.2rem;
}

.count {
  color: #666;
}

.status-tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid #ddd;
  margin-bottom: 1rem;
}

.status-tab {
  padding: 0.6rem 0;
  cursor: pointer;
  color: #333;
  position: relative;
  font-size: 0.95rem;
}

.status-tab span {
  color: #777;
  margin-left: 0.3rem;
}

.status-tab:hover {
  color: #000;
}

.status-tab.active {
  color: #2e7d32;
  font-weight: 500;
}

.status-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 3px;
  background: #2e7d32;
  border-radius: 2px 2px 0 0;
}

.notif-bell {
  position: relative;
  cursor: pointer;
  margin-right: 1rem;
}

.notif-dropdown {
  position: absolute;
  right: 0;
  top: 40px;
  width: 280px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-height: 350px;
  overflow-y: auto;
  z-index: 9999;
}

.notif {
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

.notif.unread {
  background: #f5f5f5;
}

.notif:hover {
  background: #eee;
}
.admin-nav-right {
  position: relative;
}

.notif.muted {
  padding: 1rem;
  text-align: center;
  color: #888;
  font-style: italic;
}

.notif-dropdown {
  display: none;
}

.notif-dropdown.open {
  display: block;
}
.notif-dropdown {
  color: #1f2937;   /* mørk tekst */
}
.notif {
  color: #1f2937;
}

.notif.unread {
  color: #111827;
}

ul {
  padding-left: 20px;
}

li {
  margin-bottom: 10px;
  line-height: 1.5;
  white-space: normal;
}

#offerModal .modal-content {
  background:white;
  padding:1.5rem;
  border-radius:12px;
  width:420px;
}

#offerModal label {
  font-size:0.85rem;
  color:#666;
  display:block;
  margin-top:0.5rem;
}

#offerModal input,
#offerModal select {
  width:100%;
  padding:0.6rem;
  margin-top:0.2rem;
  border:1px solid #ccc;
  border-radius:6px;
  margin-bottom:0.5rem;
}

.section {
  margin-bottom:1rem;
}

.grid-2 {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0.5rem;
}

.total-box {
  background:#f5f7fa;
  padding:0.8rem;
  border-radius:8px;
}



.muted {
  color:#777;
  font-size:0.85rem;
}

.modal {
  display:flex;
  justify-content:center;
  align-items:center;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.4);
  z-index:1000;
  overflow-y:auto; /* ✅ gjør hele modalen scrollable */
}

.modal-content {
  background:white;
  padding:1.5rem;
  border-radius:12px;
  
width:720px;        /* ← viktig */
  max-width:95vw;

  max-height:90vh;   /* ✅ viktig */
  overflow-y:auto;   /* ✅ scroll inni */
}

.offer-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
  margin-top: 1rem;
}

/* venstre kolonne seksjoner */
.offer-left .section {
  background:#f8f9fb;
  padding:0.7rem;
  border-radius:8px;
  border:1px solid #e5e7eb;
}

/* høyre = tilbehør */
.offer-right {
  background:#f8f9fb;
  padding:0.7rem;
  border-radius:8px;
  border:1px solid #e5e7eb;
}

/* tilbehør rader */
#tilbehor-lines div {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:0.5rem;
}

/* små inputs */
.small-input {
  width:80px;
  text-align:right;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  border-radius: 22px;
  transition: 0.2s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background-color: #2e7d32;
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* =========================
   OFFER MODAL – CLEAN FIX
   ========================= */

/* modal container */
#offerModal .modal-content {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  width: 720px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}

/* header */
.offer-header {
  background: #f5f7fa;
  padding: 0.7rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

/* main layout */
.offer-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

/* left column */
.offer-left {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* right column (tilbehør) */
.offer-right {
  background: #f8f9fb;
  padding: 0.8rem;
  border-radius: 8px;
  border: 1px solid #e0e3e7;
}

/* section blocks */
.section {
  background: #f8f9fb;
  padding: 0.7rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

/* labels */
#offerModal label {
  font-size: 0.85rem;
  color: #555;
  display: block;
  margin-bottom: 0.2rem;
}

/* inputs */
#offerModal input,
#offerModal select {
  width: 100%;
  padding: 0.55rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-bottom: 0.5rem;
  box-sizing: border-box;
}

/* 2-column grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

/* tilbehør list */
#tilbehor-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 260px;
  overflow-y: auto;
}

/* tilbehør row */
#tilbehor-lines div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* prisfelt tilbehør */
.tilbehor-price {
  width: 70px;
  text-align: right;
}

/* VAT toggle */
.vat-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
}

/* total box */
.total-box {
  background: #1f2937;
  color: white;
  padding: 0.8rem;
  border-radius: 8px;
  margin-top: 0.8rem;
}

.total-main {
  font-size: 1.2rem;
  font-weight: 600;
}

/* buttons */
.button-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-primary {
  flex: 1;
  background: #2e7d32;
  color: white;
  border: none;
  padding: 0.7rem;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary {
  flex: 1;
  background: #888;
  color: white;
  border: none;
  padding: 0.7rem;
  border-radius: 6px;
  cursor: pointer;
}

/* small text */
.muted {
  color: #777;
  font-size: 0.85rem;
}

/* responsive fallback */
@media (max-width: 700px) {
  .offer-layout {
    grid-template-columns: 1fr;
  }

  #offerModal .modal-content {
    width: 95vw;
  }
}

.remove-tilbehor {
  background: transparent;
  border: none;
  color: #d32f2f;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.remove-tilbehor:hover {
  opacity: 1;
  transform: scale(1.1);
}