@font-face {
  font-family: 'Big Shoulders';
  src: url('/fonts/BigShoulders-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --ink: #1C1E1C;
  --ink-soft: #34372F;
  --paper: #EEEDE6;
  --paper-raised: #F7F6F1;
  --steel: #6B7168;
  --steel-line: #D8D6CB;
  --signal: #F0B429;
  --signal-ink: #2A1F00;
  --in-green: #3F7D53;
  --out-rust: #A8412C;

  --radius-s: 3px;
  --radius-m: 6px;
  --shell-width: 640px;

  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-bottom: 4rem;
}

h1, h2 {
  font-family: 'Big Shoulders', "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}

button {
  font-family: inherit;
}

a { color: var(--ink); }

/* ---------------------------------------------------------------- */
/* Header                                                            */
/* ---------------------------------------------------------------- */

.topbar {
  background: var(--ink);
  color: var(--paper);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 3px solid var(--signal);
}

.topbar__inner {
  max-width: var(--shell-width);
  margin: 0 auto;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.wordmark {
  font-size: 1.5rem;
  color: var(--paper);
  text-transform: uppercase;
}
.wordmark span {
  color: var(--signal);
}

/* ---------------------------------------------------------------- */
/* Layout                                                             */
/* ---------------------------------------------------------------- */

.page {
  max-width: var(--shell-width);
  margin: 0 auto;
  padding: 1rem;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.sok {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--steel-line);
  border-radius: var(--radius-s);
  background: var(--paper-raised);
  font-size: 1rem;
  color: var(--ink);
}
.sok:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.chips {
  display: flex;
  gap: 0.5rem;
}

.chip {
  border: 1px solid var(--steel-line);
  background: transparent;
  color: var(--ink-soft);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
}
.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.chip:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.antall {
  color: var(--steel);
  font-size: 0.85rem;
  margin: 0.6rem 0.2rem;
}

/* ---------------------------------------------------------------- */
/* Liste                                                              */
/* ---------------------------------------------------------------- */

.liste {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--steel-line);
}

.rad {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: var(--paper-raised);
  border: none;
  border-bottom: 1px solid var(--steel-line);
  border-left: 4px solid var(--steel-line);
  padding: 0.85rem 0.9rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink);
}
.rad:hover { background: #F1EFE7; }

.rad--inne { border-left-color: var(--in-green); }
.rad--utlant { border-left-color: var(--out-rust); }

.rad__info {
  flex: 1;
  min-width: 0;
}

.rad__navn {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.rad__detalj {
  color: var(--steel);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

.rad__status {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-s);
  white-space: nowrap;
}
.rad__status--inne {
  color: var(--in-green);
  background: rgba(63,125,83,0.12);
}
.rad__status--utlant {
  color: var(--out-rust);
  background: rgba(168,65,44,0.12);
}

.tom-melding, .feilmelding {
  text-align: center;
  color: var(--steel);
  padding: 2rem 1rem;
}
.feilmelding {
  color: var(--out-rust);
}

.bunntekst {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--steel);
}
.bunntekst a { text-decoration: underline; }
.bunntekst span { margin: 0 0.5rem; }

/* ---------------------------------------------------------------- */
/* Knapper                                                            */
/* ---------------------------------------------------------------- */

.btn {
  border: none;
  border-radius: var(--radius-s);
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--paper);
  color: var(--paper);
}
.btn--ghost:hover { background: rgba(255,255,255,0.08); }

.btn--signal {
  background: var(--signal);
  color: var(--signal-ink);
}
.btn--signal:hover { filter: brightness(0.95); }

.btn--gronn {
  background: var(--in-green);
  color: #fff;
}
.btn--gronn:hover { filter: brightness(0.95); }

.btn--stor {
  width: 100%;
  padding: 0.85rem;
  font-size: 1.05rem;
}

.btn--tekst {
  background: transparent;
  color: var(--steel);
  text-decoration: underline;
  padding: 0.5rem;
}
.btn--fare { color: var(--out-rust); }

/* ---------------------------------------------------------------- */
/* Bunnark (lån/lever)                                                */
/* ---------------------------------------------------------------- */

.bakteppe {
  position: fixed;
  inset: 0;
  background: rgba(20,20,18,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.ark {
  background: var(--paper-raised);
  width: 100%;
  max-width: var(--shell-width);
  border-radius: 14px 14px 0 0;
  padding: 0.6rem 1.25rem 1.5rem;
  max-height: 88vh;
  overflow-y: auto;
}

.ark__handtak {
  width: 40px;
  height: 4px;
  background: var(--steel-line);
  border-radius: 2px;
  margin: 0.4rem auto 1rem;
}

.ark__tittel {
  font-size: 1.3rem;
  margin-bottom: 0.15rem;
}

.ark__status {
  color: var(--steel);
  margin: 0 0 1rem;
}

.ark__historikk {
  border-top: 1px solid var(--steel-line);
  border-bottom: 1px solid var(--steel-line);
  padding: 0.6rem 0;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-height: 120px;
  overflow-y: auto;
}
.ark__historikk-rad {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0;
}
.ark__historikk-tom {
  color: var(--steel);
}

.ark__skjema {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.ark__skjema label {
  font-size: 0.85rem;
  color: var(--steel);
}
.ark__skjema input {
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--steel-line);
  border-radius: var(--radius-s);
  font-size: 1rem;
}

.ark__adminrad {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

/* ---------------------------------------------------------------- */
/* Modal (nytt verktøy / rediger)                                     */
/* ---------------------------------------------------------------- */

.modal {
  background: var(--paper-raised);
  width: 100%;
  max-width: 420px;
  margin: auto;
  border-radius: var(--radius-m);
  padding: 1.5rem;
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1rem;
}
.modal label {
  font-size: 0.85rem;
  color: var(--steel);
  margin-top: 0.4rem;
}
.modal input {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--steel-line);
  border-radius: var(--radius-s);
  font-size: 1rem;
}
.modal__knapper {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* ---------------------------------------------------------------- */
/* Varsel (toast)                                                     */
/* ---------------------------------------------------------------- */

.varsel {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-m);
  font-size: 0.9rem;
  z-index: 200;
  max-width: 90vw;
  text-align: center;
  border-left: 4px solid var(--signal);
}
.varsel--feil {
  border-left-color: var(--out-rust);
}

@media (min-width: 640px) {
  .rad { border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
