/* Opally-stil: navy, Instrument Serif til overskrifter, Host Grotesk til tekst, pille-knapper */
:root {
  --navy: #1a3a4a;
  --navy-deep: #0f2a36;
  --ink: #1d3949;
  --ink-70: rgba(26, 58, 74, 0.7);
  --ink-50: rgba(26, 58, 74, 0.5);
  --line: rgba(26, 58, 74, 0.12);
  --tint: rgba(0, 112, 168, 0.07);
  --tint-strong: rgba(0, 112, 168, 0.12);
  --blue: #0070a8;
  --soft: #f2f9fc;
  --white: #ffffff;
  --green: #047857;
  --green-tint: rgba(4, 120, 87, 0.1);
  --amber: #9a6a00;
  --amber-tint: rgba(196, 140, 0, 0.12);
  --error: #b42318;
  --shadow: 0 10px 15px -3px rgba(15, 42, 54, 0.08), 0 4px 6px -4px rgba(15, 42, 54, 0.08);
  --radius: 12px;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Host Grotesk", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
body.soft { background: var(--soft); }

h1, h2.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 12px;
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 6vw, 60px); }
h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 14px; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }

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

.muted { color: var(--ink-70); }
.small { font-size: 13px; }
.mono { font-weight: 500; font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; }
.optional { color: var(--ink-50); font-weight: 400; }

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 32px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar.centered { justify-content: center; }
.topbar.dark { background: var(--navy); border-color: rgba(255, 255, 255, 0.08); }
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.04em;
}
.brand span { font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--ink-50); }
.topbar.dark .brand { color: var(--white); }
.topbar.dark .brand span { color: rgba(255, 255, 255, 0.6); }
.topbar-user { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  font: 500 15px/1 var(--sans);
  border: 1px solid transparent;
  border-radius: 9999px;
  background: var(--tint);
  color: var(--navy);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--tint-strong); }
.btn.primary { background: var(--navy); color: var(--white); }
.btn.primary:hover { background: var(--navy-deep); }
.btn.light { background: var(--white); color: var(--navy); }
.btn.glass { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.9); }
.btn.glass:hover { background: rgba(255, 255, 255, 0.16); }
.btn.small { height: 34px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn, .tab { white-space: nowrap; }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(2px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.is-loading { cursor: wait; }
.btn:focus-visible, .tab:focus-visible, input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* Lille pille-mærkat, som Opallys "AI Agents for Hotels" */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-70);
  margin: 0 0 18px;
}
.hero .eyebrow { border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.06); }
.hero .card .eyebrow { color: var(--green); background: var(--green-tint); border-color: transparent; }
.form .eyebrow, .card .eyebrow { justify-self: start; width: fit-content; }

/* ---------- Kort og formularer ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.form { display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 500; font-size: 14px; color: var(--navy); }
label.check { display: flex; align-items: center; gap: 8px; }
.form-field { display: grid; gap: 6px; }
.field-label { font-weight: 500; font-size: 14px; color: var(--navy); }

input, select, textarea {
  font: 400 15px/1.4 var(--sans);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  width: 100%;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-50); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--navy); }
input[type="date"] { font-family: var(--sans); }
.file-pick { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.file-pick .btn { cursor: pointer; }
.file-name { font-size: 13px; color: var(--ink-50); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.error { color: var(--error); margin: 0; font-size: 14px; }

/* ---------- Forside (kunde) ---------- */

.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(0, 112, 168, 0.35), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(4, 120, 87, 0.18), transparent 60%),
    var(--navy);
  color: var(--white);
}
.hero-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 72px 32px 88px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero h1 { color: var(--white); }
.brand-logo { display: block; height: 44px; width: auto; }
.hero .lead { color: rgba(255, 255, 255, 0.72); font-size: 18px; line-height: 1.55; max-width: 34ch; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .card { color: var(--ink); border-color: rgba(255, 255, 255, 0.4); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45); }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; font-size: 13px; color: var(--ink-50); }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 500; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }


.success { text-align: left; }
.success h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: -0.02em; margin-bottom: 8px; }
.case-number-big { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 22px; color: var(--navy); background: var(--tint); padding: 2px 10px; border-radius: 6px; }

/* ---------- Kundens sagsside ---------- */

.page { margin: 0 auto; padding: 56px 24px 80px; }
.page.narrow { max-width: 640px; }
.page.tiny { max-width: 420px; }
.page.wide { max-width: 1160px; padding-top: 32px; }

.steps {
  list-style: none;
  padding: 0;
  margin: 28px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.steps li {
  border-top: 3px solid var(--line);
  padding-top: 10px;
  font-size: 13px;
  color: var(--ink-50);
}
.steps li.done { border-color: var(--navy); color: var(--ink); }
.steps li.current { font-weight: 600; }

.pickup { background: var(--green-tint); border-color: transparent; box-shadow: none; color: var(--green); margin-bottom: 16px; }
.pickup strong { color: var(--navy); }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0; }
.details dt { color: var(--ink-50); font-size: 14px; }
.details dd { margin: 0; }

#error-card { display: grid; gap: 10px; justify-items: start; }
#error-card p { margin: 0; }
.powered { margin-top: 32px; font-size: 13px; color: var(--ink-50); }

/* ---------- Login ---------- */

.login-wrap { min-height: calc(100vh - 66px); display: grid; place-items: center; padding: 40px 24px; }
.login-wrap .card { width: 100%; max-width: 420px; }
.login-wrap h1 { font-size: 40px; }

/* ---------- Personale ---------- */

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--tint);
  border-radius: 9999px;
  margin-bottom: 24px;
}
.tab {
  font: 500 14px/1 var(--sans);
  background: none;
  border: none;
  border-radius: 9999px;
  padding: 10px 16px;
  color: var(--ink-70);
  cursor: pointer;
}
.tab.active { background: var(--white); color: var(--navy); box-shadow: 0 1px 3px rgba(15, 42, 54, 0.12); }
.count {
  display: inline-block;
  min-width: 20px;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 9999px;
  background: var(--navy);
  color: var(--white);
  font-size: 12px;
}
.count:empty { display: none; }

.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.dash-head h1 { font-size: 44px; margin: 0; }
.dash-head .tabs { margin-bottom: 0; }

#page-error { margin-bottom: 16px; }

.filters { display: flex; gap: 18px; margin-bottom: 16px; }
.filters label { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink-70); }

.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-50); background: rgba(26, 58, 74, 0.02); }
tr:last-child td { border-bottom: none; }
td.empty { color: var(--ink-50); text-align: center; padding: 32px; }
td.actions { text-align: right; white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--tint);
  color: var(--ink-70);
  white-space: nowrap;
}
.badge.soeges { background: var(--amber-tint); color: var(--amber); }
.badge.fundet { background: var(--green-tint); color: var(--green); }
.badge.udleveret { background: rgba(26, 58, 74, 0.06); color: var(--ink-50); }


.found-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.found-item { padding: 0; overflow: hidden; display: grid; grid-template-rows: 150px auto; }
.found-item:has(.no-image) { grid-template-rows: 56px auto; }
.found-item img { width: 100%; height: 150px; object-fit: cover; display: block; }
.no-image { display: grid; place-items: center; background: var(--soft); color: var(--ink-50); font-size: 13px; }
.found-info { padding: 16px; display: grid; gap: 10px; align-content: start; }
.found-info p { margin: 0; }
.found-info .badge { justify-self: start; }
.match-row { display: flex; gap: 6px; }
.match-row select { padding: 6px 8px; font-size: 13px; min-width: 0; }


@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-inner { padding: 48px 20px 56px; gap: 36px; }
}
@media (max-width: 900px) {
  .hero-actions { display: none; }
}
@media (max-width: 600px) {
  .form .row { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
  .page { padding: 36px 16px 64px; }
  .brand span { display: none; }
  .tabs { width: 100%; overflow-x: auto; }
  .tab { padding: 10px 12px; }
  .table-wrap table { min-width: 760px; }
  #panel-cases td:nth-child(2) { min-width: 220px; }
  #panel-cases td:nth-child(3) { white-space: nowrap; }
  #panel-cases td.actions:empty { padding: 0; }
  .brand-logo { height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .btn .arrow { transition: none; }
}

/* ---------- Personale: overblik, værktøjslinje, modaler ---------- */

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
  display: grid;
  gap: 2px;
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.stat-value { font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--ink-70); }

.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.toolbar p { margin: 0; }
.search {
  flex: 1 1 280px;
  max-width: 420px;
  border-radius: 9999px;
  padding: 10px 16px 10px 38px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%231a3a4a' stroke-opacity='.5' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 14px center;
}

.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--tint); border-radius: 9999px; }
.segmented label { display: block; font-weight: 500; color: var(--ink-70); cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 7px 14px; border-radius: 9999px; font-size: 13px; white-space: nowrap; }
.segmented input:checked + span { background: var(--white); color: var(--navy); box-shadow: 0 1px 3px rgba(15, 42, 54, 0.12); }
.segmented input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }

td.desc { min-width: 200px; }
td.nowrap { white-space: nowrap; }

.empty-state {
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-50);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.empty-state p { margin: 0; }

.modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 24px;
  border: none;
  border-radius: 16px;
  color: var(--ink);
  box-shadow: 0 30px 60px -20px rgba(15, 42, 54, 0.45);
}
.modal.wide { width: min(640px, calc(100vw - 32px)); }
.modal.narrow { width: min(440px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(15, 42, 54, 0.45); backdrop-filter: blur(2px); }
.modal[open] { animation: modal-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: -0.02em; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.icon-btn {
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--tint);
  color: var(--navy);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { background: var(--tint-strong); }

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 120px;
  padding: 16px;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--ink-70);
  font-weight: 400;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--blue); }
.dropzone img { max-height: 160px; max-width: 100%; border-radius: 8px; object-fit: cover; }

.match-item { display: flex; gap: 14px; align-items: center; padding: 12px; background: var(--soft); border-radius: 10px; }
.match-item img, .match-item .no-image { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex: none; }
.match-item p { margin: 2px 0 0; }

.case-options { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.case-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
}
.case-option:hover { border-color: rgba(0, 112, 168, 0.4); }
.case-option:has(input:checked) { border-color: var(--navy); background: var(--tint); }
.case-option input { margin-top: 3px; }
.case-option-body { display: grid; gap: 3px; min-width: 0; }
.case-option-top { display: flex; gap: 6px; align-items: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 9999px;
  background: var(--navy);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 30px -10px rgba(15, 42, 54, 0.5);
}

@media (max-width: 700px) {
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 30px; }
  .stat-label { font-size: 12px; }
  .search { max-width: none; }
  .modal { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .modal[open] { animation: none; }
}

.nowrap { white-space: nowrap; }
.dropzone { position: relative; }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone:focus-within { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 2px; }
.focus-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 10px 10px 16px;
  border-radius: 9999px;
  background: var(--tint);
  color: var(--navy);
  font-size: 14px;
  font-weight: 500;
}
@media (max-width: 600px) {
  #panel-cases th:nth-child(3), #panel-cases td:nth-child(3) { display: none; }
  .toolbar .btn.primary { width: 100%; }
}
@media (max-width: 600px) {
  .tabs { scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 10px 11px; }
  .count { margin-left: 4px; }
}
