/* app.css — Opgavesedlen. SPAR-farver hentet direkte fra logo.svg:
   rød #ED1C24 og grøn #00A651. */

:root{
  --brand: #ED1C24;
  --brand-dark: #c1121f;
  --green: #00A651;
  --ink: #26211d;
  --paper: #f7f3ec;
  --card: #ffffff;
  --line: #e7dfd3;
  --muted: #8d8478;
  --ok: #008a44; /* SPAR-grøn, mørknet en anelse for kontrast med hvid tekst */
  --warn: #b26a00;
  --danger: #b3261e;
  --blue: #1a5c9e;
}

*{ box-sizing: border-box; }
html, body{ margin: 0; padding: 0; }
body{
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  padding-bottom: 60px;
}

/* ---------- top / logo ---------- */
/* Hvid header med rød brandkant — SPAR-logoet har selv sin røde bjælke. */
.top{
  background: #fff;
  color: var(--brand);
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
  text-align: center;
  border-bottom: 4px solid var(--brand);
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
}
.logo img{ max-height: 40px; max-width: 220px; display: block; margin: 0 auto; }
.logo-text{ font-size: 22px; font-weight: 800; letter-spacing: .06em; color: var(--brand); }
.logo-sub{ font-size: 11px; font-weight: 700; letter-spacing: .38em; color: var(--brand); margin-top: 4px; }

/* ---------- generelt ---------- */
main{ max-width: 640px; margin: 0 auto; padding: 14px 12px; }
h2{ font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 4px 8px; }
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(40,30,10,.05);
}
button{
  font: inherit;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
button:disabled{ opacity: .45; cursor: default; }
.btn-brand{ background: var(--brand); color: #fff; }
.btn-brand:active{ background: var(--brand-dark); }
.btn-ok{ background: var(--ok); color: #fff; }
.btn-warn{ background: #fff; color: var(--warn); border: 1.5px solid var(--warn); }
.btn-ghost{ background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-danger-ghost{ background: #fff; color: var(--danger); border: 1.5px solid #eecac7; }
.btn-big{ display: block; width: 100%; padding: 16px; font-size: 17px; margin-bottom: 10px; }
.btn-row{ display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn-row button{ flex: 1; min-width: 130px; }
.link{ background: none; border: none; color: var(--blue); text-decoration: underline; padding: 6px; font-weight: 500; }

input[type=text], input[type=password], input[type=time], input[type=date], select, textarea{
  font: inherit;
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  margin-bottom: 8px;
}
textarea{ resize: vertical; min-height: 64px; }
label{ display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 6px 2px 4px; }

.banner{
  max-width: 640px;
  margin: 10px auto 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff4e0;
  border: 1px solid #eccf9a;
  color: #7a5200;
  font-size: 14px;
}
.banner.err{ background: #fdecea; border-color: #eecac7; color: var(--danger); }
.banner.ok{ background: #e9f6ee; border-color: #bfe3cc; color: var(--ok); }

.muted{ color: var(--muted); font-size: 13px; }
.center{ text-align: center; }

/* ---------- opgave-billetter ---------- */
.ticket{ position: relative; }
.ticket .t-head{ display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ticket .t-title{ font-size: 16px; font-weight: 700; margin: 0; }
.ticket .t-desc{ margin: 6px 0 0; font-size: 14px; white-space: pre-wrap; }
.ticket .t-meta{ display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }

.chip{
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.chip-open{ background: #fff4e0; color: #7a5200; }
.chip-review{ background: #e7f0fa; color: var(--blue); }
.chip-done{ background: #e9f6ee; color: var(--ok); }
.chip-deadline{ background: #f1ede5; color: var(--ink); }
.chip-overdue{ background: #fdecea; color: var(--danger); }
.chip-attempt{ background: #f3e7fa; color: #6a2e9e; }
.chip-date{ background: #eee9df; color: var(--muted); }

.note-box{
  margin-top: 9px;
  padding: 9px 12px;
  border-left: 4px solid var(--warn);
  background: #fff8ec;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}

.stamp{
  display: inline-block;
  transform: rotate(-6deg);
  border: 2.5px solid var(--ok);
  color: var(--ok);
  border-radius: 8px;
  padding: 3px 10px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------- billeder ---------- */
.photos{ display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.photos .ph{
  position: relative;
  width: 84px; height: 84px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  background: #eee;
}
.photos .ph img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph .rm{
  position: absolute; top: 2px; right: 2px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.62);
  color: #fff;
  font-size: 14px; line-height: 24px;
  text-align: center;
  padding: 0;
}
.photos .add{
  width: 84px; height: 84px;
  border: 2px dashed var(--brand);
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  font-size: 26px;
  font-weight: 700;
}

.lightbox[hidden]{ display: none; }
.lightbox{
  position: fixed; inset: 0;
  background: rgba(10,8,6,.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 60;
  padding: 16px;
}
.lightbox img{ max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- dato-navigation ---------- */
.datebar{
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
}
.datebar button{ background: #fff; border: 1.5px solid var(--line); width: 44px; font-size: 18px; padding: 9px 0; }
.datebar .datelabel{ flex: 1; text-align: center; font-weight: 700; }
.datebar input[type=date]{ margin: 0; width: auto; padding: 8px; }

details{ margin-top: 8px; }
details summary{ cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; }

.worker-row{
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line);
}
.worker-row:last-child{ border-bottom: 0; }

.hr-dash{ border: 0; border-top: 2px dashed var(--line); margin: 14px 0; }

.snack{
  position: fixed; left: 50%; bottom: 22px;
  transform: translateX(-50%);
  background: var(--ink); color: #fff;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 14px;
  z-index: 70;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  max-width: 90vw;
}
