:root {
  --bg: #f5efe6;
  --card: rgba(255,255,255,0.9);
  --ink: #17231e;
  --muted: #66746c;
  --line: #dfd1bf;
  --primary: #7b4b27;
  --primary-dark: #593315;
  --green: #395d48;
  --gold: #d39a4a;
  --danger: #b42318;
  --success: #147a4b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(211,154,74,0.22), transparent 28rem),
    radial-gradient(circle at 88% 10%, rgba(57,93,72,0.18), transparent 24rem),
    linear-gradient(135deg, #fbf5ec, #eef4ee);
  min-height: 100vh;
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px clamp(14px, 4vw, 42px);
  background: rgba(251,248,243,0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.brand span,
.logo-big {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-weight: 900;
}

.topbar nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 800;
}

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

.container {
  width: min(1120px, calc(100% - 28px));
  margin: 28px auto 80px;
}

.hero {
  border-radius: 30px;
  padding: 34px;
  background: linear-gradient(135deg, rgba(123,75,39,0.95), rgba(57,93,72,0.94));
  color: white;
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  box-shadow: 0 22px 70px rgba(62,44,28,0.16);
  margin-bottom: 24px;
}

.hero.compact { padding: 28px; }

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 13px;
  font-weight: 900;
  color: rgba(255,255,255,0.75);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.hero p {
  margin: 0;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

.stats div,
.card,
.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 26px;
  box-shadow: 0 16px 50px rgba(62,44,28,0.08);
}

.stats strong {
  font-size: 42px;
  display: block;
}

.stats span { color: var(--muted); }

.card { margin-bottom: 24px; }

.narrow {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.login-card {
  max-width: 520px;
  margin: 70px auto;
}

.logo-big {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  margin-bottom: 20px;
}

.login-card h1,
.card h1,
.card h2 {
  margin-top: 0;
}

.form {
  display: grid;
  gap: 16px;
}

.form label {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  background: white;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(211,154,74,0.2);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 13px 18px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  font-weight: 900;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}

.button.light {
  background: white;
  color: var(--primary);
}

.button.small {
  padding: 10px 14px;
  font-size: 14px;
  margin-top: 14px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.section-head a {
  color: var(--primary);
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 14px;
}

.status {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eee7dc;
  color: var(--primary);
  font-weight: 900;
  font-size: 13px;
}

.status.ny { background: #e8f1ff; color: #245aa5; }
.status.under_behandling { background: #fff4d8; color: #8a5b00; }
.status.venter { background: #f3e8ff; color: #6b2fa3; }
.status.utfort { background: #e4f7ed; color: #147a4b; }
.status.lukket { background: #eceff3; color: #4a5565; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.admin-action {
  padding: 22px;
  border-radius: 22px;
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 12px 36px rgba(62,44,28,0.07);
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.doc-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,0.75);
}

.doc-card h3 { margin-top: 0; }

.doc-card p {
  color: var(--muted);
  line-height: 1.55;
}

.doc-card small {
  display: block;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4ee;
  color: var(--green) !important;
  font-weight: 900;
  font-size: 13px;
}

.timeline {
  display: grid;
  gap: 16px;
}

.event-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,0.75);
}

.event-date {
  color: var(--primary);
  font-weight: 900;
}

.event-card h3 { margin: 0 0 8px; }

.event-card p {
  color: var(--muted);
  line-height: 1.55;
}

.meta { font-weight: 800; }

.error, .warning, .success {
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 800;
}

.error { background: #fff1f0; color: var(--danger); border: 1px solid #ffc9c4; }
.warning { background: #fff7df; color: #806000; border: 1px solid #ffe29b; }
.success { background: #e4f7ed; color: var(--success); border: 1px solid #bfe8d1; }
.muted { color: var(--muted); }

.footer {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto 30px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

@media (max-width: 860px) {
  .topbar {
    display: grid;
  }

  .hero,
  .section-head {
    display: grid;
  }

  .stats,
  .admin-grid,
  .document-grid {
    grid-template-columns: 1fr;
  }

  .event-card {
    grid-template-columns: 1fr;
  }
}


/* ADD Service Digital dark logo style update */
:root {
  --bg: #070b10;
  --card: rgba(15, 24, 36, 0.84);
  --ink: #f5f8fb;
  --muted: #a8b4c2;
  --line: rgba(148, 163, 184, 0.22);
  --primary: #ff2030;
  --primary-dark: #b5101b;
  --blue: #1476e8;
  --green: #21d08b;
  --gold: #f3b145;
  --danger: #ff5560;
  --success: #21d08b;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(255,32,48,0.22), transparent 30rem),
    radial-gradient(circle at 90% 10%, rgba(20,118,232,0.24), transparent 34rem),
    linear-gradient(135deg, #070b10, #101820) !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  z-index: -1;
}

.topbar {
  background: rgba(7, 11, 16, 0.82) !important;
  border-bottom: 1px solid rgba(255,255,255,0.1) !important;
  box-shadow: 0 14px 50px rgba(0,0,0,0.32);
}

.brand {
  color: white;
}

.brand-icon,
.login-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(20,118,232,0.36));
}

.brand span,
.logo-big {
  background: linear-gradient(135deg, var(--primary), var(--blue)) !important;
  box-shadow: 0 0 24px rgba(255,32,48,0.22), 0 0 28px rgba(20,118,232,0.22);
}

.topbar nav a {
  color: #cbd5e1 !important;
  border-radius: 999px;
  padding: 8px 10px;
}

.topbar nav a:hover {
  color: white !important;
  background: rgba(20,118,232,0.14);
}

.hero {
  background:
    radial-gradient(circle at 12% 22%, rgba(255,32,48,0.26), transparent 24rem),
    radial-gradient(circle at 86% 18%, rgba(20,118,232,0.28), transparent 26rem),
    linear-gradient(135deg, rgba(11,17,24,0.96), rgba(16,24,32,0.94)) !important;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 80px rgba(0,0,0,0.34), 0 0 36px rgba(20,118,232,0.12) !important;
}

.hero p,
.eyebrow {
  color: #8ac1ff !important;
}

.stats div,
.card,
.login-card,
.admin-action,
.doc-card,
.event-card {
  background: rgba(15, 24, 36, 0.84) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: white !important;
  box-shadow: 0 18px 70px rgba(0,0,0,0.28) !important;
}

.login-card {
  text-align: center;
}

.login-logo {
  display: block;
  margin: 0 auto 18px;
  width: 78px;
  height: 78px;
}

.card h1,
.card h2,
.login-card h1,
.doc-card h3,
.event-card h3,
.stats strong {
  color: white !important;
}

.stats span,
.card p,
.doc-card p,
.event-card p,
.muted,
th,
.login-card p {
  color: var(--muted) !important;
}

input,
select,
textarea {
  background: rgba(255,255,255,0.07) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  color: white !important;
}

select option {
  background: #101820;
  color: white;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(20,118,232,0.8) !important;
  box-shadow: 0 0 0 4px rgba(20,118,232,0.18), 0 0 24px rgba(20,118,232,0.16) !important;
}

button,
.button {
  background: linear-gradient(135deg, var(--primary), #d31322 42%, var(--blue)) !important;
  color: white !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  box-shadow: 0 0 26px rgba(255,32,48,0.18), 0 0 28px rgba(20,118,232,0.14);
}

.button.light {
  background: rgba(255,255,255,0.08) !important;
  color: white !important;
}

table th,
table td {
  border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

.status {
  border: 1px solid rgba(20,118,232,0.24);
  background: rgba(20,118,232,0.15) !important;
  color: #dbeafe !important;
}

.tag {
  background: rgba(20,118,232,0.14) !important;
  color: #dbeafe !important;
}

.footer {
  color: var(--muted);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
}
