/* Night Rider – ColliCares profil (som collicare.no): koksgrått, oransje og skriften Lato.
   Oransje brukes til markeringer, aldri til tekst på lys bakgrunn. */
@font-face { font-family: Lato; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/lato-400.woff2) format("woff2"); }
@font-face { font-family: Lato; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/lato-700.woff2) format("woff2"); }
@font-face { font-family: Lato; font-weight: 900; font-style: normal; font-display: swap; src: url(/fonts/lato-900.woff2) format("woff2"); }
:root {
  --charcoal: #2f2f36;
  --charcoal-2: #3d3d45;
  --slate: #5a636f;
  --grey-300: #d3d3d3;
  --grey-200: #e6e6e6;
  --grey-100: #f4f4f4;
  --white: #ffffff;
  --orange: #f29623;
  --cream: #fef8f0;
  --danger: #a3261b;
  --display: Lato, "Segoe UI", Arial, sans-serif;
  --body: Lato, "Segoe UI", Arial, sans-serif;
  --radius: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  color: var(--charcoal);
  background: var(--white);
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }

a { color: var(--charcoal); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

button, input, select, textarea { font: inherit; color: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--radius);
  border: 1px solid var(--charcoal); background: var(--white); color: var(--charcoal);
  font-size: 16px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--charcoal); color: var(--white); font-weight: bold; }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-ghost { border-color: transparent; background: transparent; text-decoration: underline; }
.btn-on-dark { border-color: var(--slate); background: transparent; color: var(--white); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: bold; }
.field .hint { font-size: 13px; color: var(--slate); }
.input, select.input, textarea.input {
  min-height: 48px; padding: 10px 14px; border: 1px solid var(--grey-300); border-radius: var(--radius);
  background: var(--white); font-size: 16px; width: 100%;
}
textarea.input { min-height: 88px; resize: vertical; }
.input-code { font-size: 26px; letter-spacing: 0.25em; text-align: center; border: 2px solid var(--charcoal); }

.error { color: var(--danger); font-size: 14px; }
.muted { color: var(--slate); font-size: 14px; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 999px; background: var(--orange); flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--charcoal-2); color: var(--white);
}
.chip-mark { background: var(--orange); color: var(--charcoal); font-weight: bold; }
.chip-light { background: var(--grey-200); color: var(--charcoal); }

/* ---------- Sjåførapp ---------- */
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  background: var(--charcoal); color: var(--white);
  padding: 16px 20px; display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 0; z-index: 2;
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; }
.brand-logo { display: block; height: 28px; width: auto; }
.topbar .brand-name { font-size: 16px; padding-left: 10px; }
.topbar .brand { gap: 10px; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.02em; padding-left: 12px; border-left: 1px solid var(--slate); line-height: 1.1; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; }
.topbar .field label { color: var(--grey-300); font-weight: normal; }
td.nowrap { white-space: nowrap; }

.search {
  display: flex; align-items: center; gap: 10px; background: var(--white); color: var(--charcoal);
  border-radius: var(--radius); padding: 0 14px; min-height: 48px;
}
.search input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: 16px; background: transparent; }
.search:focus-within { outline: 3px solid var(--orange); outline-offset: 1px; }

.sortbar { display: flex; gap: 8px; padding: 14px 20px 6px; }
.sortbar .btn { flex: 1; min-height: 44px; font-size: 15px; border-color: var(--grey-300); }
.sortbar .btn[aria-pressed="true"] { background: var(--charcoal); color: var(--white); border-color: var(--charcoal); }

.notice {
  margin: 8px 20px; background: var(--grey-100); border-radius: var(--radius);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; font-size: 14px;
}

.list { list-style: none; margin: 0; padding: 0 20px 24px; }
.list li { border-bottom: 1px solid var(--grey-300); }
.list button {
  width: 100%; text-align: left; background: none; border: 0; padding: 14px 0; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.list .name { font-size: 17px; font-weight: bold; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list .addr { font-size: 14px; color: var(--slate); }
.empty { padding: 32px 20px; color: var(--slate); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.back { color: var(--white); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; background: none; border: 0; padding: 0; cursor: pointer; font-size: 15px; }

.routebar { display: flex; align-items: center; gap: 12px; padding: 14px 20px 0; }
.routebar select { flex: 1; }

/* Instrukskort: kunde og adresse, skillelinje, leveringsinstruksjoner og kode. Bildene under på mobil, ved siden av på PC. */
.app.app-wide { max-width: 1100px; }
.detail { padding: 22px 20px 32px; display: flex; flex-direction: column; gap: 22px; }
.detail-text { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.customer h1 { margin: 0 0 8px; font-size: 22px; font-weight: bold; line-height: 1.2; }
.customer p { margin: 0 0 4px; font-size: 17px; }
.detail hr { border: 0; border-top: 1px solid var(--grey-300); margin: 0; width: 100%; }
.delivery { display: flex; flex-direction: column; gap: 12px; }
.delivery h2 { margin: 0; font-size: 17px; font-weight: bold; }
.delivery h2::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 999px; background: var(--orange); margin-right: 10px; vertical-align: 1px; }
.delivery-text {
  margin: 0; font-size: 17px; white-space: pre-line;
  border: 1px solid var(--grey-300); border-radius: var(--radius); padding: 12px 14px; background: var(--grey-100);
}
.code-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; font-size: 18px; }
.code-label { font-weight: bold; }
.code-note { flex-basis: 100%; }
.code-value { font-size: 30px; letter-spacing: 0.15em; font-weight: bold; }

.photos { display: grid; grid-template-columns: 1fr; gap: 12px; }
.photos a { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--grey-300); background: var(--grey-100); }
.photos img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: cover; }

@media (min-width: 900px) {
  .app-wide .detail { flex-direction: row; align-items: flex-start; gap: 40px; padding: 40px 32px; }
  .app-wide .detail-text { flex: 1 1 45%; }
  .app-wide .photos { flex: 1 1 55%; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .app-wide .photos img { aspect-ratio: 3 / 4; max-height: none; }
}

.login { padding: 32px 24px; display: flex; flex-direction: column; gap: 24px; flex: 1; }
.login-hero { background: var(--charcoal); color: var(--white); padding: 56px 24px 36px; }
.login-hero .brand { flex-direction: column; align-items: flex-start; gap: 18px; }
.login-hero .brand-logo { height: 56px; }
.login-hero .brand-name { font-size: 30px; border-left: 0; padding-left: 0; }
.login-hero p { margin: 14px 0 0; color: var(--grey-300); }
.steps { display: flex; flex-direction: column; gap: 12px; }
.footnote { padding: 0 24px 28px; }

/* ---------- Admin ---------- */
.admin { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side {
  flex: 1 1 220px; background: var(--charcoal); color: var(--white);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 4px;
}
.side .brand { padding: 0 12px 28px; flex-direction: column; align-items: flex-start; gap: 10px; }
.side .brand-logo { height: 46px; }
.side .brand-name { font-size: 15px; font-weight: 400; color: var(--grey-300); border-left: 0; padding-left: 0; }
.side button {
  text-align: left; background: none; border: 0; color: var(--white); padding: 12px 12px 12px 24px;
  border-radius: var(--radius); font-size: 15px; cursor: pointer; position: relative;
}
.side button[aria-current="page"] { background: var(--charcoal-2); font-weight: bold; }
.side button[aria-current="page"]::before {
  content: ""; position: absolute; left: 10px; top: 12px; bottom: 12px; width: 4px; border-radius: 2px; background: var(--orange);
}
.side .spacer { flex: 1; }
.main { flex: 999 1 560px; min-width: 0; padding: 36px 40px 48px; display: flex; flex-direction: column; gap: 24px; }
.main h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toolbar .search { border: 1px solid var(--grey-300); flex: 1; min-width: 220px; max-width: 420px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--grey-300); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { background: var(--grey-100); text-align: left; font-weight: normal; color: var(--slate); font-size: 13px; padding: 10px 14px; white-space: nowrap; }
td { padding: 12px 14px; border-top: 1px solid var(--grey-300); vertical-align: top; }
td .sub { font-size: 13px; color: var(--slate); }
td.actions { text-align: right; white-space: nowrap; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card { border: 1px solid var(--grey-300); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.card .name { display: flex; align-items: center; gap: 8px; font-weight: bold; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 32px; align-items: start; }
.section { display: flex; flex-direction: column; gap: 14px; }
.section h2 { margin: 0; font-size: 20px; }
.highlight { background: var(--grey-100); border-radius: var(--radius); padding: 16px; }

dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(640px, 94vw); max-height: 92vh; }
dialog::backdrop { background: rgba(54, 56, 63, 0.55); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: calc(92vh - 76px); }
.dialog-body h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; }
.dialog-actions { padding: 14px 24px; border-top: 1px solid var(--grey-300); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; font-weight: normal; min-height: 32px; }
/* Feilmeldinger (sjåfør) */
.list-footer { display: flex; flex-direction: column; gap: 8px; padding: 8px 20px 32px; }
.report-btn { margin-top: 8px; }
.notice-warn { margin: 0; background: #fdf1e0; }
.page-title { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; }
.checks-list { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.checks-list legend { font-weight: bold; font-size: 14px; margin-bottom: 6px; }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 16px; border-bottom: 1px solid var(--grey-200); }
.check-row input { width: 22px; height: 22px; }
.photo-picker { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.issue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.issue-list li { border: 1px solid var(--grey-300); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.issue-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.resolution { background: var(--grey-100); border-radius: var(--radius); padding: 8px 10px; font-size: 14px; }

/* Hjelp: panel fra høyre, gjennomgang («Vis meg») og «Nytt i Night Rider» */
.help-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 20;
  background: var(--white); box-shadow: -8px 0 24px rgba(54, 56, 63, 0.25);
  display: flex; flex-direction: column; gap: 12px; padding: 18px 20px;
}
.help-head { display: flex; justify-content: space-between; align-items: center; font-size: 18px; }
.help-body { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; padding-bottom: 24px; }
.help-body p, .help-body ul, .help-body ol { margin: 0; }
.help-body ul, .help-body ol { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.help-body h3, .help-body h4, .help-body h5 { margin: 8px 0 0; }
.help-title { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 0 !important; }
.help-body hr { border: 0; border-top: 1px solid var(--grey-200); width: 100%; margin: 6px 0; }
.help-body code, .tour-text code { background: var(--grey-100); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
.help-list { list-style: none; padding: 0 !important; gap: 10px !important; }
.help-link { background: none; border: 0; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; color: var(--charcoal); text-align: left; }
.help-tour-btn { align-self: flex-start; }

.tour-layer { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.tour-layer > * { pointer-events: auto; }
.tour-dim { background: rgba(54, 56, 63, 0.55); pointer-events: auto; display: flex; align-items: center; justify-content: center; }
.tour-spot {
  position: fixed; border-radius: var(--radius); pointer-events: none;
  box-shadow: 0 0 0 3px var(--orange), 0 0 0 9999px rgba(54, 56, 63, 0.55); transition: all 0.15s ease;
}
.tour-box, .help-modal {
  position: fixed; background: var(--white); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 24px);
}
.help-modal { position: static; width: min(480px, calc(100vw - 32px)); max-height: 80vh; overflow-y: auto; }
.help-modal h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; }
.tour-text p { margin: 0 0 6px; }
.tour-text ul, .tour-text ol { margin: 0; padding-left: 20px; }
.tour-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.changes { display: flex; flex-direction: column; gap: 14px; }
.changes section { display: flex; flex-direction: column; gap: 4px; }
.changes ul { margin: 0; padding-left: 20px; }

/* Innboks: faner og samlet godkjenning */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--grey-300); }
.tab {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 16px; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.tab[aria-selected="true"] { border-bottom-color: var(--orange); font-weight: bold; }
.approve-all {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: var(--grey-100); border-radius: var(--radius); padding: 12px 14px;
}
.approve-all select { width: auto; min-width: 200px; }
.dialog-group { display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--grey-300); border-radius: var(--radius); padding: 14px 16px; }
.dialog-group h3 { margin: 0; font-size: 16px; }
.dialog-body p { margin: 0; }

/* Rutevalg for sjåfør */
.route-picker { border: 1px solid var(--grey-300); border-radius: var(--radius); padding: 12px 14px; }
.route-chips { min-height: 28px; align-items: center; }
.chip-x { background: none; border: 0; padding: 0 0 0 6px; font-size: 16px; line-height: 1; cursor: pointer; color: inherit; }

/* Opter-oppslag */
.opter-lookup { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.opter-lookup label { font-weight: bold; font-size: 14px; }
.opter-lookup .input { width: 180px; min-height: 40px; }
.opter-result:empty { display: none; }
.opter-result { display: flex; flex-direction: column; gap: 8px; background: var(--grey-100); border-radius: var(--radius); padding: 12px 14px; }

/* Rapporter */
.period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.period .btn[aria-pressed="true"] { background: var(--charcoal); color: var(--white); }
.days-input { width: 90px; min-height: 40px; }
.report-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.report-head p { margin: 4px 0 0; }
.report { padding-bottom: 8px; border-bottom: 1px solid var(--grey-200); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.warn { font-weight: bold; }
tr.total td { font-weight: bold; background: var(--grey-100); }
tr.row-alert td { background: #fdf1e0; }
.alert-text { font-size: 13px; color: var(--danger); margin-top: 4px; }
.link { background: none; border: 0; padding: 0; font: inherit; font-weight: bold; text-decoration: underline; cursor: pointer; text-align: left; color: var(--charcoal); }
.inline-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }

/* Innboks */
.badge {
  display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 6px; border-radius: 999px;
  background: var(--orange); color: var(--charcoal); font-size: 12px; font-weight: bold; text-align: center;
}
.notice-admin { margin: 0; justify-content: space-between; flex-wrap: wrap; }
.upload-box {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  border: 1px dashed var(--slate); border-radius: var(--radius); padding: 18px 20px;
}
.upload-box p { margin: 4px 0 0; }
.upload-box .topbar-actions { align-items: center; }
.import-list { display: flex; flex-direction: column; gap: 14px; }
.import-card {
  display: flex; flex-wrap: wrap; gap: 20px; border: 1px solid var(--grey-300); border-radius: var(--radius); padding: 16px 18px;
}
.import-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.import-text .delivery-text { margin: 6px 0; font-size: 15px; }
.import-photos { flex: 0 1 260px; display: flex; flex-direction: column; gap: 8px; }
.import-photos img { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--grey-300); display: block; }
.issues { margin: 4px 0; padding-left: 18px; font-size: 14px; color: var(--slate); }
.issues-error { color: var(--danger); }
.checks-column { flex-direction: column; }

.image-editor { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.thumbs { display: flex; flex-wrap: wrap; gap: 12px; }
.thumb { margin: 0; display: flex; flex-direction: column; gap: 6px; width: 150px; }
.thumb img { width: 150px; height: 150px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--grey-300); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--charcoal); color: var(--white); padding: 12px 18px; border-radius: var(--radius); z-index: 10;
}

@media (max-width: 700px) {
  .main { padding: 24px 18px 40px; }
  .main h1 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Forespørsel om sjekk (verifisering) i sjåførappen */
.notice-verify { border-left: 4px solid var(--orange); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice-verify > span:nth-child(2) { flex: 1; min-width: 180px; }
.verify-box { border: 2px solid var(--orange); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--cream); }
.verify-box h2 { margin: 0; font-size: 18px; }
.verify-box p { margin: 0; }
.verify-note { font-style: italic; }
.meter { height: 6px; background: var(--grey-200); border-radius: 3px; overflow: hidden; margin-top: 4px; max-width: 160px; }
.meter > span { display: block; height: 100%; background: var(--orange); }
