:root {
  color-scheme: light;
  --bg: #f3f7f5;
  --panel: #ffffff;
  --text: #183036;
  --muted: #60767b;
  --line: #d6e1de;
  --accent: #087f8c;
  --accent-dark: #075d67;
  --accent-soft: #e4f4f3;
  --coral: #e66a4e;
  --yellow: #f4c95d;
  --green: #4e9f68;
  --blue: #3976d3;
  --ok: #28784c;
  --bad: #b24242;
  --cat: #718087;
  --cat-bg: #edf1f2;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent-dark); }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 13px clamp(16px, 4vw, 44px);
  background: var(--panel);
  border-top: 5px solid var(--yellow);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 850;
  text-decoration: none;
}
.brand span { font-size: 1.4rem; }
nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
nav a { font-weight: 700; text-decoration: none; }
.page { width: min(1120px, calc(100% - 28px)); margin: 24px auto 56px; }
h1, h2 { margin: 0 0 8px; line-height: 1.2; letter-spacing: 0; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.22rem; }
.muted { color: var(--muted); }
.title-row, .section-head, .trip-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.trip-hero {
  padding: 20px;
  background: var(--accent);
  color: white;
  border-radius: 8px;
  border-bottom: 5px solid var(--yellow);
}
.trip-hero h1 { font-size: 1.75rem; }
.trip-hero p { margin: 0; color: #e9ffff; font-weight: 600; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, button:hover { background: var(--accent-dark); }
.trip-hero .button, .trip-hero button { background: white; color: var(--accent-dark); }
.subtle { background: var(--accent-soft); color: var(--accent-dark); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card, .panel, aside {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.trip-card { position: relative; padding-right: 76px; border-top: 4px solid var(--coral); }
.trip-card-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #fff4d9;
  font-size: 1.6rem;
}
.trip-card h2 a { color: var(--text); text-decoration: none; }
.trip-card p { margin: 6px 0; }
.trip-dates { color: var(--coral); font-weight: 800; }
.trip-card .button { margin-top: 8px; }
.narrow { max-width: 720px; margin: 0 auto; }
.danger-zone {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #e5b8b2;
  border-left: 5px solid var(--bad);
  border-radius: 8px;
  background: #fff8f7;
}
.danger-zone h2 { color: var(--bad); }
.danger-zone p { margin: 4px 0 0; color: var(--muted); }
.danger-zone form { min-width: 255px; }
.confirm-delete { display: flex; grid-template-columns: none; align-items: flex-start; gap: 8px; font-size: .82rem; }
.confirm-delete input { width: auto; min-height: 0; margin-top: 3px; }
.danger-button { background: var(--bad); }
.danger-button:hover { background: #8e3030; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 750; }
input, textarea, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #bacbc7;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  background: white;
  color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: 3px solid #bce9e5; border-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; align-items: start; margin: 24px 0; }
.timeline { display: grid; gap: 12px; }
.timeline-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 6px solid var(--cat);
  border-radius: 8px;
}
.category-tog { --cat: #3976d3; --cat-bg: #eaf1fd; }
.category-fly { --cat: #e66a4e; --cat-bg: #fff0ec; }
.category-hotel { --cat: #8b68bd; --cat-bg: #f2ecfa; }
.category-transfer { --cat: #e2a72d; --cat-bg: #fff6da; }
.category-forsikring { --cat: #4e9f68; --cat-bg: #eaf6ed; }
.category-aktiviteter { --cat: #d45782; --cat-bg: #fdebf1; }
.category-andet { --cat: #718087; --cat-bg: #edf1f2; }
.timeline-item time {
  display: grid;
  align-content: start;
  gap: 3px;
  color: var(--cat);
  font-weight: 850;
}
.timeline-item time span { color: inherit; font-size: .88rem; }
.timeline-item time b { font-size: 1.25rem; }
.timeline-heading { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; }
.timeline-heading > div > strong { display: block; font-size: 1.03rem; }
.timeline-heading > div > span { display: block; color: var(--muted); font-size: .9rem; }
.category-pictogram {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--cat-bg);
  font-size: 1.5rem;
}
.timeline-details { margin-top: 11px; border-top: 1px solid #e2ebe8; }
.timeline-details summary {
  display: flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  padding: 9px 0 2px;
  color: var(--accent-dark);
  font-size: .85rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.timeline-details summary::-webkit-details-marker { display: none; }
.timeline-details summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e3f2f0;
  color: var(--accent-dark);
  font-size: 1rem;
  line-height: 1;
}
.timeline-details[open] summary::before { content: "−"; }
.timeline-details summary:hover .details-label { text-decoration: underline; }
.details-meta {
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef3f2;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
}
.details-content { padding: 7px 0 2px 28px; }
.timeline-notes { margin: 0 0 10px; }
.source-markers { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 10px; }
.source-marker {
  display: grid;
  gap: 1px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid #c9d9d5;
  border-radius: 5px;
  background: #f7fbfa;
  text-decoration: none;
  color: var(--accent-dark);
  font-size: .78rem;
  overflow-wrap: anywhere;
}
.source-marker strong { font-size: .8rem; }
.source-marker small { color: var(--muted); }
.source-marker.missing { border-style: dashed; color: var(--muted); }
.item-actions { display: flex; align-items: center; gap: 7px; }
.detail-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #bdd2ce;
  border-radius: 5px;
  background: white;
  color: var(--accent-dark);
  font: inherit;
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.detail-action:hover { background: #edf7f5; }
.detail-action.danger { border-color: #e5c0ba; color: var(--bad); }
.detail-action.danger:hover { background: #fff2f0; }
.upload-panel { margin-top: 14px; }
aside { border-top: 4px solid var(--yellow); }
.compact-form { grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 14px; }
.plain-list { display: grid; gap: 7px; padding: 0; margin: 0; list-style: none; }
.plain-list li { position: relative; padding-left: 17px; }
.plain-list li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.notice {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 6px;
  background: var(--panel);
}
.notice.success { border-color: #9ec9ad; border-left-color: var(--green); color: var(--ok); }
.notice.error { border-color: #d8a2a2; border-left-color: var(--bad); color: var(--bad); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eaf4f2; color: var(--accent-dark); }
tbody tr:hover { background: #fbfdfc; }
.document-category { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 700; }
.nowrap { white-space: nowrap; }
.item-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.inline-form { display: inline; }
.link-button {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-dark);
  font-weight: 500;
  text-decoration: underline;
}
.link-button:hover { background: transparent; }
.link-button.danger { color: var(--bad); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
legend { font-weight: 800; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.checks label { display: flex; gap: 7px; align-items: center; font-weight: 500; }
.checks input { width: auto; min-height: auto; }

@media (max-width: 760px) {
  .danger-zone { display: grid; }
  .danger-zone form { min-width: 0; }
  .topbar, .title-row, .section-head, .trip-hero { align-items: stretch; flex-direction: column; }
  .topbar { position: static; }
  .split, .columns { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 9px; }
  .timeline-item time { display: flex; align-items: baseline; gap: 8px; }
  .timeline-item time b { font-size: 1.05rem; }
  .details-content { padding-left: 0; }
  .page { margin-top: 18px; }
  h1 { font-size: 1.6rem; }
  .trip-hero h1 { font-size: 1.55rem; }
  .actions .button, .actions button { flex: 1; }
}
