/* Checkin.com Support. Färger, typsnitt och knappar efter checkin.com.

   Object Sans är licensierat och checkin.com skickar inga CORS-huvuden, så
   typsnittet går inte att hämta därifrån. Lägg ObjectSans-Regular.woff2 och
   ObjectSans-Bold.woff2 i public/assets/fonts/ när licensen tillåter det och
   ta bort kommentaren runt @font-face nedan. Till dess används systemets
   typsnitt.

@font-face { font-family: "Object Sans"; src: url("/assets/fonts/ObjectSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Object Sans"; src: url("/assets/fonts/ObjectSans-Bold.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }
*/

:root {
  --ink: #0d0d0d;
  --ink-2: rgba(13, 13, 13, 0.8);
  --muted: #5f6166;
  --bg: #f9f9f8;
  --surface: #ffffff;
  --line: #e5e7eb;
  --line-2: #c9ccd1;
  --yellow: #fbd65d;
  --yellow-hover: #f5c93a;
  --yellow-soft: #fdf3cf;
  --green: #7ec699;
  --green-soft: #e6f4eb;
  --teal-soft: #e1f5f5;
  --red: #b42318;
  --red-soft: #fdecea;
  --font: "Object Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
strong { font-weight: 600; }

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--yellow); border: 1px solid var(--ink); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 16px; }

/* --- Sidhuvud och sidfot --- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; min-height: 68px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 24px; width: auto; display: block; }
.brand span { border-left: 1px solid var(--line-2); padding-left: 12px; color: var(--ink-2); font-size: 15px; }
nav.main { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; font-size: 15px; }
nav.main a { color: var(--ink-2); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
nav.main a:hover { color: var(--ink); }
nav.main a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--yellow); }
nav.main form { margin: 0; }
button.link { font: inherit; color: var(--ink-2); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { color: var(--ink); }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; margin-top: 64px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 24px; padding-bottom: 32px; }
.foot a { color: var(--muted); }

/* --- Typografi --- */
main.wrap { padding-top: 40px; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 12px; overflow-wrap: anywhere; }
h2 { font-size: 20px; line-height: 1.3; font-weight: 700; margin: 0 0 16px; }
p { margin: 0 0 16px; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 60ch; margin-bottom: 28px; }
.meta { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; font-weight: 400; margin: 6px 0 0; }
.aside { color: var(--muted); font-size: 14px; margin-top: 20px; }
.back { margin-bottom: 20px; font-size: 15px; }
.back a { color: var(--ink-2); }

/* --- Knappar och formulär --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 16px; line-height: 1.3;
  padding: 12px 24px; min-height: 48px;
  color: var(--ink); background: var(--yellow);
  border: 1px solid var(--ink); border-radius: 0;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--yellow-hover); text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.secondary { background: var(--surface); }
.btn.secondary:hover { background: var(--bg); }

.card { background: var(--surface); border: 1px solid var(--line); padding: 24px; }
.form { margin-bottom: 24px; }
.field { margin-bottom: 22px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
label .hint { display: inline; margin-left: 4px; }
input:not([type]), input[type="email"], input[type="text"], select, textarea {
  display: block; width: 100%;
  font: inherit; color: var(--ink);
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 2px solid var(--yellow); outline-offset: 0; }
textarea { resize: vertical; min-height: 120px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
input[type="file"] { font: inherit; font-size: 15px; max-width: 100%; }
[aria-invalid="true"] { border-color: var(--red); }
.field-error { color: var(--red); font-size: 14px; margin: 6px 0 0; }
.field.check { display: flex; gap: 10px; align-items: flex-start; }
.field.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.field.check label { font-weight: 400; margin: 0; }

.notice { background: var(--green-soft); border: 1px solid var(--green); padding: 12px 16px; margin-bottom: 24px; }
.notice.error { background: var(--red-soft); border-color: var(--red); }

.narrow { max-width: 480px; }

/* --- Ärendelistor --- */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.head-row h1 { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--yellow); }
.filters { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.filters a { font-size: 14px; padding: 4px 12px; border: 1px solid var(--line-2); text-decoration: none; color: var(--ink-2); background: var(--surface); }
.filters a[aria-current="true"] { border-color: var(--ink); color: var(--ink); background: var(--yellow-soft); font-weight: 600; }

.requests { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); }
.requests li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 16px 20px; border-top: 1px solid var(--line); align-items: baseline; }
.requests li:first-child { border-top: 0; }
.requests .subject { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.requests .subject:hover { text-decoration: underline; }
.requests .meta { grid-column: 1 / -1; }
.requests .status { justify-self: start; }
.empty { background: var(--surface); border: 1px dashed var(--line-2); padding: 32px 20px; text-align: center; color: var(--ink-2); }
.more { margin-top: 20px; }

.status { display: inline-block; font-size: 13px; font-weight: 600; line-height: 1.4; padding: 2px 10px; border: 1px solid var(--ink); white-space: nowrap; vertical-align: 1px; }
.status.open { background: var(--yellow); }
.status.pending { background: var(--teal-soft); }
.status.solved { background: var(--green-soft); border-color: var(--green); }
.status.closed { background: var(--bg); border-color: var(--line-2); color: var(--muted); }

/* --- Ärende och tråd --- */
.request-head { margin-bottom: 28px; }
.request-head .meta { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.thread { list-style: none; margin: 0 0 32px; padding: 0; }
.comment { background: var(--surface); border: 1px solid var(--line); padding: 20px 24px; margin-bottom: 12px; }
.comment.team { border-left: 4px solid var(--yellow); }
.comment .who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-weight: 600; margin-bottom: 10px; }
.badge { font-size: 12px; font-weight: 600; background: var(--ink); color: var(--surface); padding: 1px 8px; }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.files { list-style: none; margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.files li { padding: 2px 0; overflow-wrap: anywhere; }
.files a::before { content: "↓ "; }

/* --- Nytt ärende --- */
.categories { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.categories a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); padding: 20px; text-decoration: none; }
.categories a:hover { border-color: var(--ink); box-shadow: 4px 4px 0 var(--yellow); }
.categories strong { display: block; font-size: 18px; margin-bottom: 6px; }
.categories span { color: var(--ink-2); font-size: 15px; }

@media (max-width: 600px) {
  main.wrap { padding-top: 28px; }
  .lede { font-size: 17px; }
  .card { padding: 20px 16px; }
  .comment { padding: 16px; }
  .requests li { grid-template-columns: 1fr; padding: 14px 16px; }
  .head-row .btn { width: 100%; }
}
