:root {
  --bg: #f7f7f8;
  --fg: #1b1b1f;
  --muted: #6b6b76;
  --border: #ddd;
  --accent: #2563eb;
  --accent-fg: #fff;
  --fare: #dc2626;
  --success-bg: #dcfce7;
  --success-fg: #166534;
  --fejl-bg: #fee2e2;
  --fejl-fg: #991b1b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1rem;
}

.topbar-venstre {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.topbar-hoejre {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.logo {
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
}

.topbar nav a {
  margin-right: 1rem;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}

.topbar nav a:hover { color: var(--fg); }

.bruger-info {
  color: var(--muted);
  font-size: 0.9rem;
  margin-right: 0.6rem;
}

.hjaelpetekst {
  color: var(--muted);
  font-size: 0.9rem;
}

.upload-form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
}

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

.side-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.1rem; margin-top: 2rem; }

.knap {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-fg);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.knap-fare { background: var(--fare); }

.link-knap {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
  text-decoration: underline;
}

table.liste {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

table.liste th, table.liste td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

table.liste th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }

.liste-simpel { list-style: none; padding: 0; }
.liste-simpel li { padding: 0.3rem 0; }

.detaljer { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; }
.detaljer dt { color: var(--muted); }
.detaljer dd { margin: 0; }

.formular { display: flex; flex-direction: column; gap: 0.9rem; max-width: 480px; }
.formular.formular-bred { max-width: 720px; }
.linje-raekke { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.linje-raekke input[type="text"] { flex: 2; }
.linje-raekke input[type="number"] { flex: 1; }
.formular label { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 500; }
.formular input, .formular textarea, .formular select {
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}
.formular textarea { min-height: 5rem; resize: vertical; }

.formular fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.formular legend { padding: 0 0.3rem; font-weight: 500; }
.formular .radio-label {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
}

.flash { list-style: none; padding: 0; margin: 0 0 1rem; }
.flash li { padding: 0.6rem 0.8rem; border-radius: 6px; margin-bottom: 0.4rem; }
.flash-success { background: var(--success-bg); color: var(--success-fg); }
.flash-fejl { background: var(--fejl-bg); color: var(--fejl-fg); }

.badge {
  background: #e5e7eb;
  color: var(--muted);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.status { padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.8rem; }
.status-åben { background: #dbeafe; color: #1e40af; }
.status-afventer { background: #fef3c7; color: #92400e; }
.status-afsluttet { background: #dcfce7; color: #166534; }

.badge-ja { background: #dcfce7; color: #166534; }
.badge-nej { background: #fef3c7; color: #92400e; }

.status-kladde { background: #e5e7eb; color: #374151; }
.status-sendt { background: #dbeafe; color: #1e40af; }
.status-betalt { background: #dcfce7; color: #166534; }

@media (max-width: 600px) {
  table.liste thead { display: none; }
  table.liste, table.liste tbody, table.liste tr, table.liste td { display: block; width: 100%; }
  table.liste tr { border-bottom: 2px solid var(--border); padding: 0.5rem 0; }
  table.liste td { border: none; padding: 0.2rem 0; }
  table.liste td[data-label]:not([data-label=""]):before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    display: block;
    font-size: 0.75rem;
  }
}
