/* ECMStar portal – kundpanel
   Ersätter admin.css (kundpanel) och style.css (inloggning) för rotkatalogen.
   admin/ och support/ har egna stilmallar och påverkas inte. */

:root {
  --bg: #e9ecef;
  --surface: #ffffff;
  --surface-2: #f5f7f9;
  --ink: #16202c;
  --ink-2: #2b3644;
  --muted: #5a6472;
  --line: #d3d9e0;
  --line-2: #e4e8ec;
  --accent: #0b5c8e;
  --accent-hover: #084a73;
  --accent-soft: #e2eef6;
  --ok: #18794e;
  --ok-soft: #dcf2e6;
  --wait: #8f5400;
  --wait-soft: #fbedd3;
  --err: #b42318;
  --err-soft: #fde6e4;
  --side: #16202c;
  --side-text: #b9c2cd;
  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 6px;
  --aside-w: 248px;
  --top-h: 60px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-cond: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --focus: 0 0 0 3px rgba(11, 92, 142, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-cond);
  color: var(--ink);
  line-height: 1.15;
  margin: 0;
  font-weight: 600;
}
p { margin: 0 0 1em; }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ */
/* Nummerplåt – det återkommande kännetecknet                          */
/* ------------------------------------------------------------------ */
.plate {
  display: inline-flex;
  align-items: stretch;
  height: 30px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 5px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  vertical-align: middle;
  flex-shrink: 0;
}
.plate::before {
  content: "";
  width: 14px;
  background: #05689f url("licenseplate.svg") center / cover no-repeat;
}
.plate span {
  display: flex;
  align-items: center;
  padding: 0 9px 0 8px;
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: .06em;
  white-space: nowrap;
}
a.plate:hover { color: var(--ink); border-color: var(--accent); }
a.plate:hover::before { filter: brightness(1.1); }
.plate-lg { height: 64px; border-width: 3px; border-radius: 8px; }
.plate-lg::before { width: 30px; }

/* ------------------------------------------------------------------ */
/* Knappar                                                             */
/* ------------------------------------------------------------------ */
.btn, .form input[type="submit"], .form button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover, .form input[type="submit"]:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: #b9c1cb; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 8px; }
.btn[aria-disabled="true"], .btn:disabled {
  background: var(--surface-2); color: #9aa3ae; border-color: var(--line-2);
  cursor: not-allowed; pointer-events: none;
}
.btn i { font-size: .95em; }

/* ------------------------------------------------------------------ */
/* Skal: sidomeny + topp                                              */
/* ------------------------------------------------------------------ */
.app { min-height: 100vh; }

aside.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--aside-w);
  background: var(--side);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  z-index: 50;
  padding: 0 12px 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--top-h);
  padding: 0 10px;
  text-decoration: none;
  color: #fff;
  margin-bottom: 8px;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #05689f;
  display: grid; place-items: center;
  color: #ffdf00;
  font-size: 15px;
}
.brand-name { font-family: var(--font-cond); font-size: 21px; font-weight: 700; letter-spacing: .01em; line-height: 1; }
.brand-name small { display: block; font-family: var(--font); font-size: 12px; font-weight: 500; color: var(--side-text); letter-spacing: 0; margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--side-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.nav a i { width: 18px; text-align: center; font-size: 15px; opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.selected { background: rgba(255,255,255,.1); color: #fff; }
.nav a.selected i { color: #7cc4ef; opacity: 1; }
.nav .nav-ext { margin-left: auto; font-size: 11px; opacity: .55; width: auto; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 12px; }
.nav-foot { margin-top: auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--top-h);
  margin-left: var(--aside-w);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 28px;
  background: rgba(233, 236, 239, .88);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 14px; color: var(--muted); margin-right: 6px; }
.topbar .who strong { color: var(--ink); font-weight: 600; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 8px;
  color: var(--ink-2);
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.menu-toggle { display: none; }

main.content {
  margin-left: var(--aside-w);
  padding: 32px 28px 64px;
}
.wrap { max-width: 1120px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 32px; font-weight: 700; }
.page-head p { color: var(--muted); margin: 6px 0 0; max-width: 60ch; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.panel-pad { padding: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { font-size: 20px; }
.panel-head a { font-size: 14px; font-weight: 600; text-decoration: none; }

/* Notiser */
.msg {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 15px;
}
.msg p { margin: 0; flex: 1; }
.msg.success { background: var(--ok-soft); color: var(--ok); }
.msg.error { background: var(--err-soft); color: var(--err); }
.msg .fa-times, .msg .fa-xmark { cursor: pointer; opacity: .7; }
.msg .fa-times:hover { opacity: 1; }
.msg:empty { display: none; }

/* Status */
.status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 600;
  padding: 4px 10px 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.ready { background: var(--ok-soft); color: var(--ok); }
.status.waiting { background: var(--wait-soft); color: var(--wait); }
.status.waiting::before { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ------------------------------------------------------------------ */
/* Översikt                                                            */
/* ------------------------------------------------------------------ */
.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.welcome { padding: 28px; }
.welcome h1 { font-size: 34px; font-weight: 700; margin-bottom: 10px; }
.welcome p { color: var(--muted); max-width: 52ch; }
.welcome .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.howto { list-style: none; margin: 24px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line-2); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: step; }
.howto li { counter-increment: step; font-size: 14px; color: var(--muted); }
.howto li strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.howto li::before {
  content: counter(step);
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 13px;
  margin-bottom: 8px;
}

.recent { list-style: none; margin: 0; padding: 6px 0; }
.recent li { display: flex; align-items: center; gap: 14px; padding: 12px 24px; }
.recent li + li { border-top: 1px solid var(--line-2); }
.recent .meta { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); }
.recent .meta b { display: block; color: var(--ink); font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 32px 24px; text-align: center; color: var(--muted); }
.empty i { font-size: 26px; color: #a6afba; display: block; margin-bottom: 10px; }
.empty p { margin: 0 0 14px; }

.prices { margin-top: 20px; }
.price-list { list-style: none; margin: 0; padding: 0; }
.price-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; padding: 16px 24px; align-items: baseline; }
.price-list li + li { border-top: 1px solid var(--line-2); }
.price-list h3 { font-size: 18px; }
.price-list .incl { grid-column: 1; color: var(--muted); font-size: 14px; }
.price-list .price { grid-column: 2; grid-row: 1 / span 2; align-self: center; text-align: right; font-family: var(--font-cond); font-size: 22px; font-weight: 600; white-space: nowrap; }
.price-list .price small { display: block; font-family: var(--font); font-size: 12px; font-weight: 500; color: var(--muted); }
.price-foot { padding: 14px 24px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Filservice-lista                                                   */
/* ------------------------------------------------------------------ */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search-field { position: relative; flex: 1 1 260px; max-width: 360px; }
.search-field i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #8b95a1; font-size: 14px; pointer-events: none; }
.search-field input {
  width: 100%; height: 42px; padding: 0 12px 0 38px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font: inherit; font-size: 15px; color: var(--ink);
  text-transform: uppercase;
}
.search-field input::placeholder { text-transform: none; color: #8b95a1; }
.search-field input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }

.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 3px; }
.segmented a { padding: 7px 14px; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.segmented a:hover { color: var(--ink); }
.segmented a.on { background: var(--ink); color: #fff; }

.files { width: 100%; border-collapse: collapse; }
.files th {
  text-align: left; font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.files th:first-child { border-top-left-radius: var(--radius-lg); padding-left: 24px; }
.files th:last-child { border-top-right-radius: var(--radius-lg); padding-right: 24px; }
.files td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 15px; }
.files td:first-child { padding-left: 24px; }
.files td:last-child { padding-right: 24px; }
.files tbody tr:last-child td { border-bottom: 0; }
.files .date { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.files .cat { color: var(--ink-2); }
.files .dl { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.files .num { color: #8b95a1; font-variant-numeric: tabular-nums; font-size: 14px; }

details.info summary {
  cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 600; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
details.info summary::-webkit-details-marker { display: none; }
details.info summary i { font-size: 11px; transition: transform .15s ease; }
details.info[open] summary i { transform: rotate(90deg); }
details.info .info-body {
  margin-top: 8px; padding: 10px 12px;
  background: var(--surface-2); border-radius: 8px;
  font-size: 14px; color: var(--ink-2);
  white-space: pre-line; max-width: 46ch;
}

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--line-2); font-size: 14px; color: var(--muted); }
.pagination .pg { display: flex; gap: 8px; }

/* ------------------------------------------------------------------ */
/* Formulär                                                            */
/* ------------------------------------------------------------------ */
.form { display: flex; flex-direction: column; gap: 18px; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--muted); }
.form input[type="text"], .form input[type="email"], .form input[type="password"],
.form input[type="url"], .form input[type="number"], .form input[type="tel"],
.form select, .form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.form select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%235a6472' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.form input:hover, .form select:hover, .form textarea:hover { border-color: #b9c1cb; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.form-row { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.form-msg { color: var(--err); font-weight: 500; margin: 0; }
.form-msg:empty { display: none; }

/* Detaljlista (profil/faktura) */
.details { margin: 0; display: grid; grid-template-columns: 200px minmax(0, 1fr); }
.details dt, .details dd { padding: 14px 0; border-bottom: 1px solid var(--line-2); margin: 0; }
.details dt { color: var(--muted); font-size: 14px; font-weight: 500; }
.details dd { font-weight: 500; overflow-wrap: anywhere; }
.details dd.missing { color: #9aa3ae; font-weight: 400; font-style: italic; }
.details dt:last-of-type, .details dd:last-of-type { border-bottom: 0; }

/* Uppladdning */
.upload-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.plate-input {
  display: inline-flex;
  align-items: stretch;
  height: 72px;
  border: 3px solid var(--ink);
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
  width: 100%;
  max-width: 300px;
}
.plate-input::before { content: ""; width: 34px; background: #05689f url("licenseplate.svg") center / cover no-repeat; flex-shrink: 0; }
.form .plate-input input {
  border: 0; border-radius: 0; min-height: 0; height: 100%;
  font-family: var(--font-cond); font-weight: 600; font-size: 40px; letter-spacing: .1em;
  text-transform: uppercase; text-align: center; padding: 0 8px;
  box-shadow: none;
}
.form .plate-input input::placeholder { color: #c7cdd4; }
.plate-input:focus-within { box-shadow: var(--focus); }

.drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 28px 20px;
  border: 2px dashed #b4bec9;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  text-align: center;
  color: var(--muted);
  transition: border-color .15s ease, background-color .15s ease;
}
.drop i { font-size: 26px; color: var(--accent); }
.drop strong { color: var(--ink); font-size: 16px; }
.drop span { font-size: 14px; }
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.drop.has-file i { color: var(--ok); }
.drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop:focus-within { box-shadow: var(--focus); }

.progress { display: none; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress.on { display: block; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.progress-label { display: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-label.on { display: block; }

.aside-note h2 { font-size: 18px; margin-bottom: 10px; }
.aside-note ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.aside-note li + li { margin-top: 6px; }
.aside-note + .aside-note { margin-top: 16px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100;
  transform: translate(-50%, 20px); opacity: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 500;
  box-shadow: 0 12px 32px rgba(22, 32, 44, .3);
  transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok i { color: #6fe0a6; }
.toast.err i { color: #ff8f85; }

/* Swish */
.pay-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.pay-grid img { display: block; width: 100%; border-radius: var(--radius-lg); }
.swish-no { font-family: var(--font-cond); font-size: 34px; font-weight: 600; letter-spacing: .02em; margin: 4px 0 12px; }
.copy { font-size: 14px; }

/* Om */
.prose { max-width: 68ch; }
.prose h2 { font-size: 22px; margin: 28px 0 10px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.contact-list { list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.contact-list li { display: flex; align-items: center; gap: 12px; }
.contact-list i { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }

/* ------------------------------------------------------------------ */
/* Inloggning / registrering                                          */
/* ------------------------------------------------------------------ */
body.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; background: var(--surface); }
.auth-side {
  background: var(--side);
  color: var(--side-text);
  padding: 40px 56px;
  display: flex; flex-direction: column;
}
.auth-side .brand { padding: 0; height: auto; margin-bottom: 0; }
.auth-pitch { margin: auto 0; max-width: 440px; padding: 48px 0; }
.auth-pitch h1 { color: #fff; font-size: 46px; font-weight: 700; letter-spacing: -.005em; margin-bottom: 16px; }
.auth-pitch p { font-size: 17px; }
.auth-pitch .plate { height: 52px; border-color: #fff; border-width: 3px; margin-bottom: 28px; }
.auth-pitch .plate::before { width: 24px; }
.auth-pitch .plate span { font-size: 32px; padding: 0 14px; }
.auth-steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.auth-steps li { counter-increment: s; display: flex; gap: 12px; align-items: baseline; }
.auth-steps li::before { content: counter(s); flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: 13px; font-weight: 600; }
.auth-foot { font-size: 13px; }
.auth-foot a { color: var(--side-text); }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 30px; font-weight: 700; margin-bottom: 6px; }
.auth-card > p { color: var(--muted); margin-bottom: 24px; }
.auth-card .form { max-width: none; gap: 16px; }
.auth-card .form input[type="submit"] { width: 100%; height: 46px; font-size: 16px; }
.auth-card .switch { margin-top: 22px; font-size: 15px; color: var(--muted); text-align: center; }
.auth-card .switch a { font-weight: 600; text-decoration: none; }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.auth-card .msg { margin: 0; }
.auth-card .msg:not(:empty) { background: var(--err-soft); color: var(--err); }
.auth-card .msg.ok:not(:empty) { background: var(--ok-soft); color: var(--ok); }
.recaptcha-note { font-size: 12px; color: #8b95a1; margin-top: 14px; text-align: center; }
.recaptcha-note a { color: inherit; }
.grecaptcha-badge { visibility: hidden; }

/* ------------------------------------------------------------------ */
/* Responsivt                                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 1080px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .upload-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  aside.sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: none; }
  body.nav-open aside.sidebar { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.35); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(22,32,44,.4); z-index: 45; }
  .topbar, main.content { margin-left: 0; }
  .topbar { padding: 0 12px 0 8px; }
  .menu-toggle { display: inline-grid; }
  main.content { padding: 22px 16px 48px; }
  .page-head h1 { font-size: 28px; }
  .welcome { padding: 22px; }
  .welcome h1 { font-size: 28px; }
  .howto { grid-template-columns: minmax(0, 1fr); }
  .pay-grid { grid-template-columns: minmax(0, 1fr); }
  .pay-grid img { max-width: 300px; }
  .details { grid-template-columns: minmax(0, 1fr); }
  .details dt { padding-bottom: 0; border-bottom: 0; }
  .details dd { padding-top: 2px; }
  .topbar .who { display: none; }

  /* Fil-tabellen blir kort */
  .files thead { display: none; }
  .files, .files tbody, .files tr, .files td { display: block; width: 100%; }
  .files tr { padding: 16px; border-bottom: 1px solid var(--line-2); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; }
  .files tbody tr:last-child { border-bottom: 0; }
  .files td { padding: 0 !important; border: 0; }
  .files td.c-num { display: none; }
  .files td.c-plate { grid-column: 1; grid-row: 1; }
  .files td.c-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .files td.c-cat.is-empty, .files td.c-info.is-empty { display: none; }
  .files td.c-date, .files td.c-cat { grid-column: 1 / -1; font-size: 14px; }
  .files td.c-cat { font-weight: 600; font-size: 15px; margin-bottom: -6px; }
  .files td.c-date::before { content: "Uppladdad "; color: var(--muted); }
  .files td.c-info, .files td.c-dl { grid-column: 1 / -1; }
  .files .dl { justify-content: flex-start; }
  .files .dl .btn { flex: 1; }
  details.info .info-body { max-width: none; }
  .pagination { padding: 14px 16px; }
  .panel-head, .price-list li, .recent li, .price-foot { padding-left: 16px; padding-right: 16px; }
  .panel-pad { padding: 18px; }

  body.auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { padding: 18px 16px 22px; }
  .auth-pitch p { margin: 0; font-size: 16px; }
  .auth-pitch { padding: 18px 0 0; margin: 0; }
  .auth-pitch h1 { font-size: 28px; margin-bottom: 8px; }
  .auth-pitch .plate, .auth-steps, .auth-foot { display: none; }
  .auth-main { align-items: flex-start; padding: 28px 16px 40px; }
}

@media (max-width: 520px) {
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .plate-input { max-width: none; }
  .price-list li { grid-template-columns: minmax(0, 1fr); }
  .price-list .price { grid-column: 1; grid-row: auto; text-align: left; }
  .price-list .price small { display: inline; margin-left: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.label-muted { font-size: 14px; font-weight: 500; color: var(--muted); }
.panel.narrow { max-width: 760px; }
@media (max-width: 900px) { .pay-grid img { max-width: 240px; } }

/* ------------------------------------------------------------------ */
/* Support                                                            */
/* ------------------------------------------------------------------ */
[hidden] { display: none !important; }
.support-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.muted-p { color: var(--muted); font-size: 14px; }
.btn-block { width: 100%; }
.status.open { background: #d3e6f3; color: var(--accent); }
.status.closed { background: var(--line-2); color: var(--muted); }

.ticket-list { list-style: none; margin: 0; padding: 0; }
.ticket-list li + li { border-top: 1px solid var(--line-2); }
.ticket-row {
  display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 18px; align-items: center;
  padding: 16px 24px; color: inherit; text-decoration: none;
}
.ticket-row:hover { background: var(--surface-2); color: inherit; }
.ticket-list li:first-child .ticket-row { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.ticket-list li:last-child .ticket-row { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.ticket-subject b { font-family: var(--font-cond); font-size: 18px; font-weight: 600; line-height: 1.2; display: block; }
.ticket-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ticket-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.ticket-id { color: #8b95a1; font-weight: 500; font-variant-numeric: tabular-nums; }
.prio-high { color: var(--err); background: var(--err-soft); padding: 1px 8px; border-radius: 99px; font-size: 12px; }
.prio-high-text { color: var(--err); }
.ticket-excerpt { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ticket-date { font-size: 13px; color: var(--muted); white-space: nowrap; }

.back-link { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; text-decoration: none; margin-bottom: 14px; }
.ticket-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.ticket-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ticket-title h1 { font-size: 30px; font-weight: 700; }
.plate-md { height: 46px; border-width: 3px; border-radius: 7px; }
.plate-md::before { width: 21px; }
.plate-md span { font-size: 28px; padding: 0 12px; }
.ticket-facts { display: flex; gap: 28px; margin: 0; flex-wrap: wrap; }
.ticket-facts dt { font-size: 13px; color: var(--muted); }
.ticket-facts dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }

.thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; position: relative; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px 20px; }
.post.staff { border-color: #b8d3e6; background: #f4f9fc; }
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-head time { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--line-2); color: var(--ink-2); font-weight: 700; font-size: 14px; flex: none; }
.avatar.staff { background: #05689f; color: #ffdf00; font-size: 13px; }
.author b { font-weight: 600; }
.post-body { color: var(--ink-2); overflow-wrap: anywhere; max-width: 72ch; }
.post-files { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.post-files img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.waiting-note { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin: 16px 4px 0; }
.reply { margin-top: 20px; max-width: none; }
.reply.form { max-width: none; }

.form-row.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
.seg-input { display: flex; height: 44px; }
.seg-input label { flex: 1; display: flex; cursor: pointer; }
.seg-input input { position: absolute; opacity: 0; pointer-events: none; }
.seg-input span { flex: 1; display: grid; place-items: center; border-radius: 7px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg-input label:hover span { color: var(--ink); }
.seg-input input:checked + span { background: var(--ink); color: #fff; }
.seg-input input:focus-visible + span { box-shadow: var(--focus); }

@media (max-width: 1080px) {
  .support-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .ticket-row { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; gap: 8px 12px; }
  .ticket-subject { grid-column: 1; grid-row: 1; }
  .ticket-side { grid-column: 2; grid-row: 1; }
  .ticket-body { grid-column: 1 / -1; }
  .ticket-excerpt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ticket-facts { gap: 18px; }
  .ticket-title h1 { font-size: 24px; }
  .post { padding: 16px; }
  .post-head { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .form-row.two { grid-template-columns: minmax(0, 1fr); }
  .ticket-facts { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
}

/* ------------------------------------------------------------------ */
/* v4: notiser, statusflöde, revisioner, betalning                    */
/* ------------------------------------------------------------------ */
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack > .aside-note + .aside-note { margin-top: 0; }
.pre-line { white-space: pre-line; color: var(--ink-2); margin: 0; }
.panel-title { font-size: 18px; margin-bottom: 8px; }

.nav-label { padding: 2px 12px 6px; font-size: 12px; font-weight: 600; color: #7d8896; letter-spacing: .02em; }
.nav-badge {
  margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px;
  display: inline-grid; place-items: center;
  background: #ffdf00; color: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.nav-badge + .nav-ext { margin-left: 8px; }

.status.received { background: var(--line-2); color: var(--ink-2); }
.new-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 99px; background: #ffdf00; color: var(--ink); font-size: 12px; font-weight: 700; vertical-align: middle; }
.files tr[data-href] { cursor: pointer; }
.files tbody tr:hover td { background: var(--surface-2); }
.files tr.is-new td { background: #fffbe0; }
.files tr.is-new:hover td { background: #fff6c2; }
.files tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-lg); }
.files tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius-lg); }
.pay { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; }
.pay.paid { color: var(--ok); }
.pay.due { color: var(--wait); }
.pay.due:hover { color: #6b3f00; text-decoration: underline; }

/* Stegvisare */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 110px; text-align: center; }
.stepper li + li::before { content: ""; position: absolute; top: 8px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.stepper li.done + li::before, .stepper li.done + li.current::before { background: var(--ok); }
.stepper .dot { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.stepper .done .dot { background: var(--ok); border-color: var(--ok); }
.stepper .done .dot::after { content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.stepper .current .dot { border-color: var(--wait); background: var(--wait-soft); box-shadow: 0 0 0 4px rgba(143, 84, 0, .12); }
.stepper .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.stepper .done .lbl { color: var(--ok); }
.stepper .current .lbl { color: var(--wait); }

.file-head { align-items: center; }
.file-title { font-size: 24px; }
.file-sub { font-size: 14px; color: var(--muted); }

.wait-box { display: flex; gap: 14px; align-items: center; padding: 18px 24px; background: var(--wait-soft); color: var(--wait); border-bottom: 1px solid var(--line-2); }
.wait-box i { font-size: 22px; }
.wait-box p { margin: 0; font-weight: 500; }
.fa-spin-slow { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.rev-list { list-style: none; margin: 0; padding: 0; }
.rev { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 24px; }
.rev + .rev { border-top: 1px solid var(--line-2); }
.rev-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); }
.rev.latest .rev-icon { background: var(--ok-soft); color: var(--ok); }
.rev-title b { font-weight: 600; }
.rev-meta { display: block; font-size: 13px; color: var(--muted); }
.rev-note { display: flex; gap: 10px; margin-top: 10px; padding: 10px 12px; background: #f4f9fc; border: 1px solid #cfe2ef; border-radius: 10px; }
.rev-note .avatar { width: 24px; height: 24px; font-size: 11px; }
.rev-note p { margin: 0; font-size: 14px; color: var(--ink-2); }
.rev .btn { margin-top: 2px; }

.pay-card .pay-amount { font-family: var(--font-cond); font-size: 36px; font-weight: 700; margin: 0 0 4px; }
.pay-state { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 14px; }
.pay-state.ok { color: var(--ok); margin: 0; }
.pay-state.due { color: var(--wait); }

.notice-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; margin-bottom: 20px;
  background: #fff6c2; border: 1px solid #f0dc6c; border-radius: var(--radius-lg);
  color: var(--ink); text-decoration: none;
}
.notice-bar > i { color: var(--wait); font-size: 18px; }
.notice-bar:hover { background: #ffef9e; color: var(--ink); }
.notice-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); white-space: nowrap; }

.recent li { padding: 0; }
.recent-row { display: flex; align-items: center; gap: 14px; padding: 12px 24px; color: inherit; text-decoration: none; }
.recent-row:hover { background: var(--surface-2); color: inherit; }

/* Swish */
.swish-card { padding: 24px; text-align: center; }
.qr { width: 100%; max-width: 240px; aspect-ratio: 1; margin: 0 auto 16px; }
.qr svg, .qr img { width: 100%; height: auto; display: block; }
.swish-amount { font-family: var(--font-cond); font-size: 34px; font-weight: 700; margin: 0; }
.swish-msg { color: var(--muted); font-size: 14px; margin: 2px 0 14px; }
.swish-msg b { color: var(--ink); letter-spacing: .04em; }
.swish-no { display: flex; align-items: center; justify-content: center; gap: 4px 8px; margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.swish-no .label-muted { flex-basis: 100%; }
.swish-no b { font-family: var(--font-cond); font-size: 20px; }
.only-touch { display: none; }
@media (pointer: coarse) { .only-touch { display: inline-flex; } }

.pay-list { list-style: none; margin: 0; padding: 0; }
.pay-list li + li { border-top: 1px solid var(--line-2); }
.pay-list a { display: flex; align-items: center; gap: 14px; padding: 14px 24px; color: inherit; text-decoration: none; }
.pay-list a:hover { background: var(--surface-2); }
.pay-list .meta { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); }
.pay-list .meta b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.pay-sum { font-family: var(--font-cond); font-size: 20px; font-weight: 600; white-space: nowrap; }
.pay-list .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.pay-list li.on .radio { border: 6px solid var(--accent); }
.pay-list li.on a { background: var(--accent-soft); }
.all-paid { display: flex; gap: 14px; align-items: center; }
.all-paid i { font-size: 28px; color: var(--ok); }
.all-paid b { display: block; }
.all-paid span { color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .files td.c-pay { grid-column: 1 / -1; }
  .files td.c-pay.is-empty { display: none; }
  .files tr.is-new { background: #fffbe0; }
  .files tr.is-new td, .files tbody tr:hover td { background: transparent; }
  .stepper { width: 100%; }
  .stepper li { flex: 1; width: auto; }
  .rev { grid-template-columns: 36px minmax(0, 1fr); padding: 14px 16px; }
  .rev-icon { width: 36px; height: 36px; }
  .rev .btn { grid-column: 2; justify-self: start; }
  .wait-box { padding: 16px; }
  .recent-row, .pay-list a { padding-left: 16px; padding-right: 16px; }
  .notice-bar { flex-wrap: wrap; }
  .notice-cta { margin-left: 30px; }
}

/* ------------------------------------------------------------------ */
/* Admin: arbetskö, fil, statistik                                    */
/* ------------------------------------------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); color: inherit; text-decoration: none; }
a.kpi:hover { border-color: #b9c1cb; color: inherit; }
.kpi-num { font-family: var(--font-cond); font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-lbl { font-size: 14px; color: var(--muted); }
.delta { font-size: 13px; font-weight: 600; margin-top: 4px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--err); }

.queue .c-cust b { display: block; font-weight: 600; }
.queue .c-cust .sub { display: block; font-size: 13px; color: var(--muted); }
.inline-form { margin: 0; }
.stage-select {
  appearance: none; font: inherit; font-size: 14px; font-weight: 600;
  padding: 5px 30px 5px 12px; border-radius: 99px; border: 1px solid transparent; cursor: pointer;
  background: var(--line-2) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='currentColor' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--ink-2);
}
.stage-select.s-working { background-color: var(--wait-soft); color: var(--wait); }
.stage-select.s-ready { background-color: var(--ok-soft); color: var(--ok); }
.stage-select:focus-visible { outline: none; box-shadow: var(--focus); }
.paid-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap; }
.paid-toggle input { width: 18px; height: 18px; accent-color: var(--ok); margin: 0; }
.paid-toggle input:checked + span { color: var(--ok); }
.paid-toggle input:not(:checked) + span { color: var(--wait); }
.drop-btn { position: relative; cursor: pointer; }
.drop-row td { transition: background-color .12s ease; }
.drop-row.drag td { background: var(--accent-soft) !important; }
.drop-row.drag td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.row-progress { height: 3px; margin-top: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; display: none; }
.row-progress div { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.drop-row.uploading .row-progress { display: block; }
.drop-row.uploading .dl { opacity: .5; pointer-events: none; }

.stage-pick { display: flex; flex-direction: column; gap: 6px; }
.stage-pick button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px;
  font: inherit; font-size: 15px; font-weight: 600; text-align: left; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.stage-pick button::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.stage-pick button:hover { border-color: #b9c1cb; }
.stage-pick button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.stage-pick button.on::before { border: 4px solid var(--accent); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; align-self: flex-start; }
.link-btn:hover { text-decoration: underline; }
.mini-dl { margin: 0 0 14px; font-size: 14px; }
.mini-dl dt { color: var(--muted); margin-top: 8px; }
.mini-dl dt:first-child { margin-top: 0; }
.mini-dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.ext-links { display: flex; gap: 16px; margin-top: 14px; font-size: 14px; font-weight: 600; }
.form.wide { max-width: none; }
.aside-note .form { gap: 14px; }

.chart-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; align-items: start; }
.bars { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin-top: 14px; }
.bars-grid { display: flex; flex-direction: column; justify-content: space-between; height: 180px; font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.bars-grid span { transform: translateY(-50%); }
.bars-grid span:last-child { transform: translateY(50%); }
.bars-plot {
  position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; height: 180px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--line-2) 1px, transparent 1px) 0 0 / 100% 50%;
}
.bar { position: relative; display: flex; align-items: flex-end; height: 100%; outline: none; }
.bar-fill { display: block; width: 100%; max-width: 28px; margin: 0 auto; min-height: 0; background: var(--accent); border-radius: 4px 4px 0 0; }
.bar:hover .bar-fill, .bar:focus .bar-fill { background: var(--accent-hover); }
.bar-lbl { position: absolute; top: calc(100% + 6px); left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); }
.bar.current .bar-lbl { color: var(--ink); font-weight: 600; }
.bar-tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 7px; white-space: nowrap;
  pointer-events: none; opacity: 0; z-index: 2;
}
.bar-tip b { display: block; font-size: 14px; }
.bar:hover .bar-tip, .bar:focus .bar-tip { opacity: 1; }
.bars { padding-bottom: 22px; }
.bar { --h: 0; }

.files.simple td, .files.simple th { padding-top: 11px; padding-bottom: 11px; }
.num-col { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.share { display: block; height: 4px; margin-top: 6px; background: var(--line-2); border-radius: 3px; max-width: 220px; }
.share span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

@media (max-width: 1080px) {
  .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpis .kpi:first-child:nth-last-child(3) { grid-column: 1 / -1; }
  .kpi-num { font-size: 24px; }
  .queue td.c-cust, .queue td.c-cat { grid-column: 1 / -1; }
  .queue td.c-pay { grid-column: 1 / -1; }
  .files.simple, .files.simple tbody, .files.simple tr, .files.simple td { display: revert; width: auto; }
  .files.simple thead { display: table-header-group; }
  .files.simple tr { display: table-row; padding: 0; }
  .files.simple td { display: table-cell; padding: 10px 16px !important; border-bottom: 1px solid var(--line-2); }
}

/* Ta bort */
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #8f1c13; color: #fff; }
.btn-danger-ghost { background: var(--surface); color: var(--err); border-color: #f1c2bd; }
.btn-danger-ghost:hover { background: var(--err-soft); color: var(--err); border-color: var(--err); }
.icon-btn.danger:hover { color: var(--err); background: var(--err-soft); border-color: #f1c2bd; }
.danger-zone { border-color: #f1c2bd; }
.danger-zone h2 { color: var(--err); }
dialog.confirm { border: 0; padding: 0; border-radius: var(--radius-lg); width: min(420px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(22,32,44,.35); }
dialog.confirm::backdrop { background: rgba(22,32,44,.5); }
.confirm-body { padding: 26px 24px 22px; }
.confirm-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--err-soft); color: var(--err); margin-bottom: 14px; font-size: 18px; }
.confirm-body h2 { font-size: 22px; margin-bottom: 6px; }
.confirm-body p { color: var(--muted); margin: 0 0 18px; }
.confirm-body .form-actions { justify-content: flex-end; }
.rev-actions { display: flex; gap: 6px; align-items: center; }
.rev-actions form { margin: 0; }

/* Admin: kunder & inställningar */
.accounts-table .c-cust { display: flex; align-items: center; gap: 12px; }
.who-cell { min-width: 0; }
.who-cell b { display: block; font-weight: 600; }
.who-cell .sub { display: block; font-size: 13px; color: var(--muted); }
.tag { display: inline-block; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; }
.tag.warn { background: var(--wait-soft); color: var(--wait); }
.accounts-table .c-mail { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.accounts-table tr[data-href] { cursor: pointer; }
.accounts-table tbody tr:hover td { background: var(--surface-2); }
.avatar-lg { width: 52px; height: 52px; font-size: 22px; }
.input-group { display: flex; gap: 6px; }
.input-group input { flex: 1; min-width: 0; font-family: var(--font); letter-spacing: .02em; }
.input-group .btn { height: 44px; padding: 0 14px; }

.narrow-stack { max-width: 760px; }
.settings-form { gap: 16px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 4px 0; cursor: pointer; }
.switch-row b { display: block; font-weight: 600; }
.switch-row .hint { display: block; font-size: 13px; color: var(--muted); }

.toggle { appearance: none; flex: none; width: 46px; height: 26px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background-color .15s ease; margin: 0; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease; }
.toggle:checked { background: var(--ok); }
.toggle:checked::after { transform: translateX(20px); }
.toggle:focus-visible { box-shadow: var(--focus); }
.toggle:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 900px) {
  .accounts-table td.c-cust { grid-column: 1; grid-row: 1; }
  .accounts-table td.c-go { grid-column: 2; grid-row: 1; justify-self: end; }
  .accounts-table td.c-mail, .accounts-table td.c-seen { grid-column: 1 / -1; }
  .accounts-table td.c-n::before { content: "Filer: "; color: var(--muted); }
  .accounts-table td.c-n, .accounts-table td.c-unpaid { text-align: left !important; font-size: 14px; }
  .accounts-table td.c-seen::before { content: "Senast inloggad "; }
}
.recent-row .spacer { flex: 1; }
@media (max-width: 900px) {
  .accounts-table tbody tr:hover td, .queue tbody tr:hover td { background: transparent; }
  .accounts-table tbody tr:hover, .queue tbody tr:hover { background: var(--surface-2); }
  .accounts-table td.c-unpaid:has(.date) { display: none; }
}
.cat-list { list-style: none; margin: 14px 0; padding: 0; }
.cat-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.cat-list li form { margin: 0; }
.cat-row { display: flex; align-items: center; gap: 10px; flex: 1; }
.cat-row input[type="text"] { flex: 1; min-width: 0; height: 38px; padding: 0 10px; font: inherit; font-size: 15px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); }
.cat-row input[type="text"]:hover { border-color: var(--line); }
.cat-row input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); background: var(--surface); }
.cat-row .date { font-size: 13px; white-space: nowrap; }
.cat-add input[type="text"] { border-color: var(--line); background: var(--surface); }
.attach-list { display: flex; gap: 8px; flex-wrap: wrap; }
.attach-list img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.drop-sm { padding: 18px 16px; } .drop-sm i { font-size: 20px; } .drop-sm strong { font-size: 15px; }



/* Fakturering */
.month-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.month-pick { position: relative; display: inline-flex; align-items: center; }
.month-pick input[type="month"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.month-name { font-family: var(--font-cond); font-size: 26px; font-weight: 700; padding: 0 6px; min-width: 190px; text-align: center; }
.month-bar .segmented { margin-left: auto; }
.bill { margin-bottom: 18px; }
.bill-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 24px 14px; }
.bill-cust h2 { font-size: 21px; }
.bill-cust p { margin: 4px 0 0; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.warn-line { color: var(--wait) !important; font-weight: 600; gap: 6px !important; align-items: center; }
.bill-table th { border-top: 1px solid var(--line-2); }
.bill-table th:first-child, .bill-table th:last-child { border-radius: 0; }
.bill-table .plate { height: 26px; }
.bill-table .plate span { font-size: 16px; }
.bill-table tr.no-price td { background: var(--wait-soft); }
.bill-table tfoot td { padding-top: 8px; padding-bottom: 8px; border-bottom: 0; color: var(--muted); font-size: 14px; }
.bill-table tfoot tr:first-child td { border-top: 1px solid var(--line); padding-top: 12px; }
.bill-table tfoot tr.grand td { color: var(--ink); font-weight: 700; font-size: 16px; padding-bottom: 14px; }
.bill-table tfoot tr.grand td.num-col { font-family: var(--font-cond); font-size: 22px; }
.bill-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 24px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.bill-actions form { margin: 0; display: flex; gap: 8px; }
.bill-actions .spacer { flex: 1; }
.inv-form input[type="text"] { width: 120px; height: 34px; padding: 0 10px; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; }
.inv-form input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.plate-link { text-decoration: none; }

@media (max-width: 900px) {
  .bill-table, .bill-table tbody, .bill-table tfoot, .bill-table thead { display: revert !important; }
  .bill-table tr { display: table-row !important; padding: 0 !important; }
  .bill-table td, .bill-table th { display: table-cell !important; padding: 8px 10px !important; font-size: 13px; }
  .bill-table th:nth-child(4), .bill-table td:nth-child(4) { display: none !important; }
  .month-bar .segmented { margin-left: 0; }
  .bill-head, .bill-actions { padding-left: 16px; padding-right: 16px; }
}

@media print {
  aside.sidebar, .topbar, .no-print, .bill-actions, dialog { display: none !important; }
  body, main.content, .topbar { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .panel { border: 0 !important; box-shadow: none !important; }
  .bill { page-break-after: always; }
  body.printing-one .bill:not(.print-target) { display: none !important; }
}
.pay.invoiced, .pay-state.invoiced { color: var(--accent); }
.pay-state.invoiced { margin: 0 0 6px; }

/* Liknande original */
.sim-intro { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.sim-intro p { flex: 1 1 320px; margin: 0; }
.sim-ids { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.sw-id { font-family: var(--font-cond); font-size: 15px; font-weight: 600; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 6px; }
.sim-size { margin-left: auto; }
.sim-table .sub-line { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.sim-table td { vertical-align: top; }
.sim-bar { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.sim-bar span { display: block; height: 100%; background: var(--accent); }
.sim-pct { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sim-table td:nth-child(3) { white-space: nowrap; }
.sim-table td:nth-child(3) .sub-line { white-space: normal; }
.sim-table .sim-mod .btn { white-space: nowrap; }
.sim-badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 13px; font-weight: 700; }
.sim-badge.exact { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 900px) {
  .sim-table, .sim-table tbody, .sim-table thead { display: revert !important; }
  .sim-table tr { display: table-row !important; padding: 0 !important; }
  .sim-table td, .sim-table th { display: table-cell !important; padding: 8px !important; }
  .sim-table th:nth-child(2), .sim-table td:nth-child(2), .sim-table .sim-open, .sim-table th:last-child { display: none !important; }
  .sim-bar { width: 56px; }
  .sim-table { min-width: 0 !important; width: 100%; }
  .sim-table .sim-mod .lbl { display: none; }
  .sim-table .sim-mod .btn { padding: 8px 10px; min-width: 40px; justify-content: center; }
  .sim-table .sim-mod .btn i { margin: 0; }
  .sim-table .sim-mod-h { font-size: 0 !important; }
  .sim-table td:nth-child(3) { white-space: normal; }
}
