@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-400.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-500.woff") format("woff"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/poppins-600.woff") format("woff"); }

:root {
  --navy: #0d2b4e;
  --navy-2: #163d69;
  --sky: #e3effa;
  --accent: #1fa3d8;
  --line: #dde4ec;
  --muted: #5b6b7d;
  --bg: #ffffff;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--navy); background: var(--bg);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.notice { background: var(--sky); font-size: 13px; text-align: center; padding: 9px 16px; }

.site-header { border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { font-weight: 600; font-size: 22px; letter-spacing: -0.02em; }
.brand .dot { color: var(--accent); }

.btn {
  display: inline-block; background: var(--navy); color: #fff; border: 0; cursor: pointer;
  font: inherit; font-weight: 500; text-decoration: none; border-radius: 999px;
  padding: 14px 28px; transition: background .2s;
}
.btn:hover { background: var(--navy-2); }
.btn-small { padding: 9px 22px; font-size: 14px; }
.btn-full { width: 100%; font-size: 16px; }

.hero { background: var(--sky); text-align: center; padding: 64px 0 56px; }
.hero h1 { margin: 0; font-size: clamp(28px, 4.5vw, 42px); font-weight: 600; letter-spacing: -0.02em; }
.hero p { margin: 0; color: var(--muted); }

.main { display: grid; grid-template-columns: 1fr 1.15fr; gap: 64px; padding-top: 64px; padding-bottom: 80px; align-items: start; }

.product { position: sticky; top: 104px; }
.product-img { background: #fff; border-radius: var(--radius); overflow: hidden; }
.product-img img { display: block; width: 100%; height: auto; }
.product h2 { margin: 24px 0 0; font-size: 26px; font-weight: 600; }
.muted { color: var(--muted); margin: 2px 0 0; }
.price { font-size: 28px; font-weight: 600; margin: 14px 0 0; }
.price span { font-size: 14px; font-weight: 400; color: var(--muted); }
.facts { list-style: none; padding: 0; margin: 18px 0 0; border-top: 1px solid var(--line); }
.facts li { padding: 10px 0 10px 22px; border-bottom: 1px solid var(--line); position: relative; font-size: 15px; }
.facts li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.order h2 { margin: 0 0 24px; font-size: 26px; font-weight: 600; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 22px 0 26px; }
legend { font-weight: 600; font-size: 17px; padding: 0 0 12px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid[hidden] { display: none; }
.f.full { grid-column: 1 / -1; }
label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.opt { color: var(--muted); font-weight: 400; }
input, textarea {
  width: 100%; font: inherit; color: var(--navy); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; padding: 11px 13px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,163,216,.15); }
input.invalid { border-color: #d64545; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.check input.invalid { outline: 2px solid #d64545; }
#deliveryFields { margin-top: 16px; }

.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 22px; }
.qty-row label { margin: 0; font-size: 16px; }
.qty { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 44px; border: 0; background: #fff; font-size: 20px; color: var(--navy); cursor: pointer; }
.qty button:hover { background: var(--sky); }
.qty input { width: 64px; border: 0; border-radius: 0; text-align: center; padding: 10px 0; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.summary { background: var(--sky); border-radius: var(--radius); padding: 20px 22px; margin: 4px 0 20px; }
.summary div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 15px; }
.summary .total { border-top: 1px solid rgba(13,43,78,.15); margin-top: 8px; padding-top: 12px; font-weight: 600; font-size: 17px; }
.terms { font-size: 14px; margin-bottom: 18px; }
.error { color: #c03030; font-size: 14px; margin: 0 0 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--muted); }
.site-footer p { margin: 2px 0; }
.site-footer a { color: inherit; }
.site-footer .footer-admin { text-decoration: none; opacity: .55; }
.site-footer .footer-admin:hover { opacity: 1; text-decoration: underline; }

.result { max-width: 560px; margin: 0 auto; padding: 80px 24px; text-align: center; }
.result h1 { font-size: 30px; font-weight: 600; margin: 0 0 10px; }
.result p { color: var(--muted); }
.result .summary { text-align: left; margin: 28px 0; }
.result .btn { margin-top: 12px; }

@media (max-width: 860px) {
  .main { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
  .product { position: static; }
  .product-img { max-width: 360px; }
  .hero { padding: 44px 0 40px; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
}

.text-page { max-width: 720px; padding-top: 56px; padding-bottom: 72px; }
.text-page h1 { font-size: 34px; font-weight: 600; margin: 0 0 24px; letter-spacing: -0.02em; }
.text-page h2 { font-size: 19px; font-weight: 600; margin: 32px 0 8px; }
.text-page p { margin: 0 0 12px; color: #2c3e52; }
.text-page a, .terms a { color: inherit; }

/* Popup: endast vårdpersonal */
.gate { position: fixed; inset: 0; z-index: 100; background: rgba(13,43,78,.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.gate[hidden] { display: none; }
.gate-open, .gate-open body { overflow: hidden; }
.gate-box { background: #fff; border-radius: 20px; max-width: 520px; width: 100%; padding: 44px 40px 36px; text-align: center; box-shadow: 0 20px 60px rgba(13,43,78,.25); }
.gate-kicker { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.gate-box h2 { font-size: 32px; font-weight: 500; margin: 0 0 14px; letter-spacing: -0.01em; }
.gate-box p { color: var(--navy); font-size: 15px; margin: 0 0 12px; }
.gate-box p a { color: inherit; }
.gate-box .btn { margin-top: 12px; }
.gate-box .btn:first-of-type { margin-top: 20px; }
.btn-outline { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-outline:hover { background: var(--sky); }
@media (max-width: 480px) { .gate-box { padding: 32px 22px 26px; } .gate-box h2 { font-size: 26px; } }
.terms-link { display: block; margin-top: 4px; font-size: 13px; color: var(--muted) !important; }

/* ===== Konton och admin ===== */
a.brand { color: inherit; text-decoration: none; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.nav a:not(.btn) { color: var(--navy); text-decoration: none; }
.nav a:not(.btn):hover { color: var(--accent); }
select {
  width: 100%; font: inherit; color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 38px 11px 13px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230d2b4e' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,163,216,.15); }
.f.saved { margin-bottom: 16px; }
.logged-in { margin: -14px 0 22px; font-size: 14px; color: var(--muted); }
.logged-in a { color: var(--navy); }
.small { font-size: 13px; }
.mt { margin-top: 32px !important; }

.flash { border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; font-size: 14px; }
.flash a { color: inherit; font-weight: 500; }
.flash-ok { background: #e7f6ee; color: #14532d; }
.flash-error { background: #fdecec; color: #8a1c1c; }
.flash-info { background: var(--sky); color: var(--navy); }

.btn-link { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--navy); text-decoration: underline; cursor: pointer; }
.btn-link.danger { color: #b42318; }
.btn:disabled { opacity: .6; cursor: default; }

/* Inloggning m.m. */
.auth { display: flex; justify-content: center; padding: 64px 20px 88px; background: var(--sky); }
.auth-box { background: #fff; border-radius: 20px; width: 100%; max-width: 440px; padding: 40px 36px; box-shadow: 0 10px 40px rgba(13,43,78,.08); }
.auth-box h1 { margin: 0 0 6px; font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.auth-box > .muted { margin: 0 0 22px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack .btn { margin-top: 6px; }
.form-h { font-size: 16px; font-weight: 600; margin: 10px 0 0; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 14px; margin: 20px 0 0; color: var(--muted); }
.auth-links a { color: var(--navy); }

/* Konto- och adminsidor */
.hero-small { padding: 40px 0 34px; }
.hero-small p { margin-top: 4px; }
.account { padding-top: 36px; padding-bottom: 80px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; margin-bottom: 24px; }
.card h2 { font-size: 21px; font-weight: 600; margin: 0 0 18px; }
.card h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 0 0 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.card-head h2 { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 -8px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; white-space: nowrap; }
.table a { color: var(--navy); }
.row-link { cursor: pointer; }
.row-link:hover td { background: #f7fafd; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 500; background: var(--sky); }
.badge-skickad { background: #b6dff5; color: #064a72; }
.badge-fakturerad { background: #d9f2e3; color: #166534; }
.badge-makulerad { background: #fdecec; color: #8a1c1c; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.inline { display: inline; margin: 0; }
.status-select { width: auto; padding: 6px 32px 6px 12px; font-size: 13px; border-radius: 999px; background-position: right 12px center; }
.status-ny { background-color: var(--sky); border-color: transparent; font-weight: 500; }
.status-skickad { background-color: #b6dff5; color: #064a72; border-color: transparent; font-weight: 500; }
.status-fakturerad { background-color: #d9f2e3; color: #166534; border-color: transparent; font-weight: 500; }
.status-makulerad { background-color: #fdecec; border-color: transparent; }

.addr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.addr-cols.three { grid-template-columns: repeat(3, 1fr); margin: 24px 0 8px; }
.addr-cols p { font-size: 14px; line-height: 1.7; margin: 0; }
.addr-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; font-size: 14px; line-height: 1.6; }
.add-addr { margin-top: 20px; }
.add-addr summary { list-style: none; display: inline-block; }
.add-addr summary::-webkit-details-marker { display: none; }
.add-addr-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.seg { display: flex; gap: 8px; }
.seg label { display: flex; gap: 8px; align-items: center; margin: 0; font-weight: 400; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.seg input { width: auto; accent-color: var(--navy); }
.grid > [hidden] { display: none; }

.tabs { display: flex; gap: 6px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 16px; color: var(--muted); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--navy); border-color: var(--navy); }
.count { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters a { font-size: 14px; color: var(--navy); text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); }
.filters a span { color: var(--muted); margin-left: 2px; }
.filters a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.filters a.active span { color: rgba(255,255,255,.7); }
.tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search input { width: 340px; padding: 8px 14px; border-radius: 999px; font-size: 14px; }
.note-form { margin-top: 20px; max-width: 520px; }
.note-form .btn { align-self: flex-start; }
.settings-grid { display: grid; grid-template-columns: 1fr 220px; gap: 28px; align-items: start; margin-bottom: 8px; }
.settings-img { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.settings-img img { display: block; width: 100%; height: auto; }
.card > .grid { margin-bottom: 20px; }
input[type=file] { padding: 9px; }

/* Popup: lösenord */
.gate-field { text-align: left; margin-top: 18px; }
.show-pw { margin-top: 10px; font-size: 14px; }
.gate-field .error { margin: 8px 0 0; }
.gate-box .btn-link { margin-top: 16px; }

@media (max-width: 860px) {
  .addr-cols, .addr-cols.three, .settings-grid { grid-template-columns: 1fr; gap: 20px; }
  .settings-img { max-width: 220px; }
}
@media (max-width: 560px) {
  .nav { gap: 14px; font-size: 14px; }
  .nav .btn-small { display: none; }
  .card { padding: 20px; border-radius: 12px; }
  .auth-box { padding: 30px 22px; }
  .search input { width: 100%; }
}
.stack .btn { align-self: flex-start; }
.stack .btn.btn-full { align-self: stretch; }
input:disabled { background: #f4f6f9; color: var(--muted); }

/* Frakt med UPS */
.tag-warn { color: #8a5a00; border-color: #f0c36d; background: #fff7e0; font-size: 12px; padding: 3px 8px; }
.frakt-table { margin-bottom: 20px; }
.frakt-table tr.voided td { color: var(--muted); }
.frakt-table tr.voided .tracking { text-decoration: line-through; color: var(--muted); }
.frakt-table .tracking { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.frakt-table td.r .btn { margin-right: 8px; }
.frakt-form summary { cursor: pointer; font-weight: 500; margin-bottom: 16px; }
.frakt-form form { max-width: 640px; }
.frakt-vikt { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.check input { width: auto; }
.mt-s { margin: 0 0 14px; }
.btn-frakt { white-space: nowrap; padding: 7px 16px; font-size: 13px; text-decoration: none; }
.table a.btn-frakt { color: #fff; }
.table a.btn-frakt.btn-outline { color: var(--navy); }
.sysinfo { display: grid; grid-template-columns: minmax(160px, 240px) 1fr; gap: 8px 20px; margin: 18px 0 20px; font-size: 14px; }
.sysinfo dt { color: var(--muted); }
.sysinfo dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .sysinfo { grid-template-columns: 1fr; gap: 2px; } .sysinfo dd { margin-bottom: 10px; } }
.ups-mode { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; margin: 4px 0 18px; border: 1px solid; }
.ups-mode > div { display: flex; flex-direction: column; gap: 2px; }
.ups-mode.is-test { background: #fff7e0; border-color: #f0c36d; }
.ups-mode.is-live { background: #e8f6ee; border-color: #9ed3b3; }
.subsection { border-top: 1px solid var(--line, #e3e8ef); padding-top: 18px; margin-top: 22px; }
.card > h2 + .subsection { border-top: 0; padding-top: 0; margin-top: 14px; }
.subsection h3 { font-size: 16px; margin: 0 0 12px; }
.subsection .muted.small { margin-top: 8px; }
.subsection .muted.small { margin-bottom: 14px; }
#mail > .btn { margin-top: 4px; }
/* Info-knapp (i) med förklaring som fälls ut */
.sub-head { position: relative; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sub-head h3 { margin: 0; }
.info summary { list-style: none; cursor: pointer; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); color: var(--muted); font: 600 12px/18px Georgia, serif; font-style: italic; text-align: center; user-select: none; }
.info summary::-webkit-details-marker { display: none; }
.info summary:hover, .info[open] summary { background: var(--navy, #0d2b4e); border-color: var(--navy, #0d2b4e); color: #fff; }
.info-box { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(13,43,78,.12); padding: 14px 16px; font-size: 14px; line-height: 1.55; max-width: 620px; }
.info-box ul { margin: 8px 0; padding-left: 20px; }
.radio-row { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 14px; }
.check.small { font-size: 13px; margin-top: 6px; }
.mail-error { background: #fdecec; color: #8a1c1c; border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 14px 0 0; }
#frakt-inst > .btn, #mail > .btn { margin-top: 18px; }
/* Hopfällbara rutor (System) */
details.fold { padding: 0; }
details.fold > summary.fold-head { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 16px; padding: 22px 28px; border-radius: inherit; }
details.fold > summary.fold-head::-webkit-details-marker { display: none; }
details.fold > summary.fold-head::after { content: ""; grid-row: 1 / span 2; grid-column: 2; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; margin-right: 4px; }
details.fold[open] > summary.fold-head::after { transform: rotate(-135deg); }
details.fold > summary.fold-head:hover { background: #f7f9fc; }
details.fold > summary h2 { margin: 0; }
.fold-sum { grid-column: 1; font-size: 13px; color: var(--muted); margin-top: 4px; }
.fold-warn { color: #8a5a00; font-weight: 600; }
.fold-ok { color: #1d7a46; font-weight: 600; }
.fold-body { padding: 0 28px 28px; }
details.fold[open] > summary.fold-head { padding-bottom: 8px; }
details.fold .fold-body > .subsection:first-of-type { border-top: 1px solid var(--line); padding-top: 18px; }
@media (max-width: 600px) { details.fold > summary.fold-head { padding: 18px 18px; } .fold-body { padding: 0 18px 22px; } }
.fold-body > .btn { margin-top: 18px; }
.text-page .updated { font-size: 13px; color: var(--muted); margin-top: 32px; }
/* Inloggningskod (verifiera.php) */
.code-input { font-size: 26px; letter-spacing: .45em; text-align: center; font-variant-numeric: tabular-nums; padding-left: .45em; }
.code-timer { margin: 0; text-align: center; }
.resend { margin-top: 18px; text-align: center; }
.resend .btn-link:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.resend a { color: var(--navy); }
/* Logga i sidhuvudet */
.brand-logo { display: block; height: 38px; width: auto; max-width: 260px; object-fit: contain; }
@media (max-width: 600px) { .brand-logo { max-width: 170px; max-height: 40px; } }

/* Admin → Utseende */
.design-cols { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; margin: 8px 0 20px; }
@media (max-width: 860px) { .design-cols { grid-template-columns: 1fr; } }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.theme-opt { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 14px; }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; }
.theme-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.swatches { display: flex; gap: 4px; }
.swatches i { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); }
.swatches i.rainbow { width: 86px; border-radius: 13px; background: linear-gradient(90deg, #0d2b4e, #2e9e6a, #c0395b, #8e5cc7, #1fa3d8); }
.custom-colors { margin-top: 16px; display: grid; gap: 10px; max-width: 420px; }
.color-f span { display: flex; gap: 8px; }
.color-f input[type=color] { width: 48px; height: 44px; padding: 3px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; flex: none; }
.contrast-warn { background: #fff7e0; border: 1px solid #f0c36d; color: #8a5a00; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 4px 0 0; }
.preview { --pv-navy: var(--navy); --pv-sky: var(--sky); --pv-accent: var(--accent); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; color: var(--pv-navy); font-size: 13px; position: sticky; top: 90px; }
.pv-notice { background: var(--pv-sky); text-align: center; padding: 6px 10px; font-size: 11px; }
.pv-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pv-brand { font-weight: 600; font-size: 16px; }
.pv-brand img { display: block; height: 26px; width: auto; max-width: 180px; }
.pv-btn { background: var(--pv-navy); color: #fff; border-radius: 999px; padding: 6px 14px; font-size: 12px; font-weight: 500; }
.pv-hero { background: var(--pv-sky); padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pv-hero strong { font-size: 18px; }
.pv-muted { color: var(--muted); }
.pv-dot { width: 34px; height: 4px; border-radius: 2px; background: var(--pv-accent); }
.pv-big { margin-top: 8px; padding: 9px 18px; }
.logo-box { border: 1px dashed var(--line); border-radius: 12px; min-height: 110px; display: flex; align-items: center; justify-content: center; padding: 18px; background: #fafbfd; }
.logo-box img { max-width: 100%; max-height: 80px; }
.fav-box img { width: 48px; height: 48px; }
.custom-colors[hidden], .contrast-warn[hidden] { display: none; }
/* Följesedel-knappar */
.nowrap { white-space: nowrap; }
td.nowrap .btn + .btn { margin-left: 6px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.gate-fields.is-off { opacity: .5; }
.gate-off-note { color: #8a5a00; }
/* Kundsök */
.kund-search { display: flex; gap: 10px; align-items: center; }
.kund-search input[type=search] { flex: 1; font-size: 16px; }
@media (max-width: 600px) { .kund-search { flex-wrap: wrap; } .kund-search input[type=search] { flex-basis: 100%; } }
/* Ny order åt kund (admin) */
.nyorder fieldset { border: 0; padding: 0; margin: 18px 0 0; }
.nyorder legend { font-weight: 600; font-size: 16px; margin-bottom: 10px; display: flex; gap: 12px; align-items: baseline; width: 100%; }
.nyorder legend .btn-link { font-weight: 400; font-size: 13px; }
.nyorder .stack > .f, .nyorder fieldset > .f { margin-bottom: 12px; }
.nyorder-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .nyorder-cols { grid-template-columns: 1fr; } }
.nyorder-antal { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.nyorder-antal label { font-weight: 600; }
.nyorder .qty { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.nyorder .qty button { width: 44px; border: 0; background: #fff; font-size: 20px; cursor: pointer; color: var(--navy); }
.nyorder .qty input { width: 70px; border: 0; text-align: center; font-size: 17px; border-radius: 0; -moz-appearance: textfield; }
.nyorder .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.nyorder-sum { max-width: 420px; }
.nyorder .mt { margin-top: 22px; }
/* Kundlistor utan sidscroll */
.table td.kontakt { overflow-wrap: break-word; word-break: normal; min-width: 300px; line-height: 1.5; }
.table td.kontakt a { white-space: nowrap; }
@media (max-width: 900px) { .table td.kontakt { min-width: 0; } .table td.kontakt a { white-space: normal; overflow-wrap: anywhere; } }
.table td.actions { white-space: nowrap; width: 1%; }
.table td.actions .btn { display: block; margin: 0 0 6px auto; width: max-content; }
.table td.actions .btn-link { font-size: 13px; }
/* Säkerhetskopia och aktivitetslogg */
.backup-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.backup-form .f { flex: 1; min-width: 220px; max-width: 360px; margin: 0; }
.logg-table td { font-size: 14px; vertical-align: top; }
.logg-table tr.logg-warn td { background: #fff7e0; }
/* Användare */
.role-opts { display: grid; gap: 10px; }
.role-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.role-opt:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; }
.role-opt input { margin-top: 4px; width: auto; }
.role-opt > span { display: flex; flex-direction: column; gap: 2px; }
/* Admin-menyn: aldrig bredare än skärmen */
.tabs { flex-wrap: wrap; }
.tabs a { white-space: nowrap; }
@media (max-width: 760px) {
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; border-bottom: 0; }
  .tabs a { padding: 10px 4px; text-align: center; font-size: 14px; border: 1px solid var(--line); border-radius: 10px; margin: 0; overflow: hidden; text-overflow: ellipsis; }
  .tabs a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
  .tabs a.active .count { background: #fff; color: var(--navy); }
}
@media (max-width: 360px) { .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Version och ändringslogg */
.footer-version { opacity: .5; font-variant-numeric: tabular-nums; }
.changelog { list-style: none; padding: 0; margin: 8px 0 0; }
.changelog > li { border-top: 1px solid var(--line); padding: 12px 0; }
.cl-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cl-ver { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600; color: var(--navy); background: var(--sky); border-radius: 999px; padding: 2px 9px; }
.changelog ul { margin: 6px 0 0; padding-left: 20px; font-size: 14px; color: var(--muted); }
.changelog ul li { margin-bottom: 3px; }
/* Ny kund – kontrollera */
.tag-new { background: #fff7e0; border-color: #f0c36d; color: #8a5a00; font-size: 11px; margin-top: 4px; white-space: nowrap; }
.new-customer { background: #fff7e0; border: 1px solid #f0c36d; color: #6b4600; border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 0 0 16px; }
.radio-stack { display: grid; gap: 8px; margin-top: 4px; }
.gate-when { margin: 10px 0 4px; }
.search-info { margin: -4px 0 12px; }
/* Lagersaldo */
.stock-badge { display: inline-block; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 12px; margin: 4px 0 0; }
.stock-badge.stock-in { background: #e8f6ee; color: #1d7a46; }
.stock-badge.stock-low { background: #fff7e0; color: #8a5a00; }
.stock-badge.stock-out { background: #fdecec; color: #8a1c1c; }
.stock-f .stock-badge { margin: 6px 8px 0 0; }
.stock-f .muted.small { display: block; margin-top: 6px; }
.stock-notice, .stock-alert, .restorder-note { border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 0 0 14px; border: 1px solid; }
.stock-notice.stock-out, .stock-alert.stock-out { background: #fdecec; border-color: #f2b8b8; color: #8a1c1c; }
.stock-notice.stock-low, .stock-alert.stock-low, .restorder-note { background: #fff7e0; border-color: #f0c36d; color: #6b4600; }
.tag-rest { background: #fdecec; border-color: #f2b8b8; color: #8a1c1c; font-size: 11px; margin-top: 4px; white-space: nowrap; }
#submitBtn:disabled { opacity: .55; cursor: not-allowed; }
.stock-fields.is-off { opacity: .5; }

/* Leveransadress: kunden måste välja aktivt (ingen förvald) */
.lev-choice { background: var(--sky); border: 2px solid var(--accent); border-radius: 12px; padding: 14px 16px 16px; outline: none; }
.lev-choice.invalid { border-color: #d64545; background: #fdf0f0; }
.lev-q { margin: 0 0 10px; font-weight: 600; }
.lev-choice.invalid .lev-q { color: #b42318; }
.lev-opt { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-weight: 400; }
.lev-opt + .lev-opt { margin-top: 8px; }
.lev-opt input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.lev-opt > span { display: flex; flex-direction: column; gap: 2px; }
.lev-opt:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy); }
.lev-choice:has(input:checked) { background: transparent; border-color: transparent; padding: 0; }
#deliveryFields { margin-top: 14px; }

/* Radera kunddata (System) */
.btn-danger { background: #b42318; border-color: #b42318; color: #fff; }
.btn-danger:hover { background: #8f1c13; }
.btn-danger-outline { color: #b42318; border-color: #b42318; }
.btn-danger-outline:hover { background: #fdecec; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.erase-confirm { background: #fdf0f0; border: 2px solid #d64545; border-radius: 12px; padding: 16px 18px; margin: 0 0 18px; }
.erase-confirm h3 { margin: 0 0 6px; color: #b42318; }
.erase-confirm form.inline { margin-right: 8px; }
.erased-note { background: #f1f3f6; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin: 0 0 14px; }
.erased-note strong { color: var(--navy); }
.tag-erased { background: #f1f3f6; border-color: var(--line); color: var(--muted); font-size: 11px; }

/* Radera makulerad order */
.order-delete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
td .inline .btn-link.danger { font-size: 13px; margin-left: 10px; }
.void-warn { background: #fdecec; border-color: #f2b8b8; color: #8a1c1c; }
.void-warn a { color: inherit; font-weight: 600; }

/* Inställningar → Följesedel */
.settings-row { display: grid; grid-template-columns: 1fr 260px; gap: 18px; align-items: center; }
@media (max-width: 700px) { .settings-row { grid-template-columns: 1fr; } }
#foljesedel textarea { min-height: 76px; }

/* Inloggning för kunder (Inställningar): pris och beställning bara för inloggade */
.price-login { font-size: 17px; }
.price-login a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.login-required { background: var(--sky); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.login-required h2 { margin-top: 0; }
.login-required .btn { margin-top: 6px; }
.login-required .center { text-align: center; margin: 12px 0 0; }
.login-required .center a { color: var(--navy); font-weight: 600; }

/* Inställningar: meny till vänster, vald inställning till höger */
.settings-split.js { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-split:not(.js) .settings-nav { display: none; }
.settings-nav { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; position: sticky; top: 16px; }
.sn-group { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 14px 10px 6px; }
.sn-group:first-child { margin-top: 8px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--navy); text-decoration: none; font-size: 14.5px; }
.settings-nav a:hover { background: #f3f7fb; }
.settings-nav a.on { background: var(--sky); font-weight: 600; }
.sn-ico { display: inline-flex; width: 30px; height: 30px; border-radius: 8px; background: var(--sky); color: var(--navy); align-items: center; justify-content: center; flex: none; }
.settings-nav a.on .sn-ico { background: #fff; }
.sn-ico svg { width: 17px; height: 17px; }
.sn-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-split.js > * { min-width: 0; }
.settings-nav a { min-width: 0; }
.sn-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #1f9d55; }
.sn-dot.on { background: var(--accent); }
.sn-dot.warn { background: #e0a100; }
.sn-dot.off { background: transparent; border: 1.5px solid #9aa7b4; width: 7px; height: 7px; }
.settings-split.js .settings-panels details.fold { margin-top: 0; }
.settings-split.js .settings-panels details.fold > summary { cursor: default; }
.settings-split.js .settings-panels details.fold > summary::after { display: none; }
.settings-split.js .settings-panels details.fold > summary h2 { font-size: 21px; }
@media (max-width: 800px) {
  .settings-split.js { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; }
  .settings-nav a { padding: 6px 8px; }
}
.settings-split.js .settings-panels details.fold > summary.fold-head:hover { background: none; }
.site-footer .footer-copy { margin-top: 10px; font-size: 13px; opacity: .75; }

/* Ändra adresser på en order */
.order-edit { margin: 4px 0 18px; }
.order-edit > summary { cursor: pointer; font-weight: 600; color: var(--navy); padding: 6px 0; }
.order-edit form { margin-top: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.edit-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.edit-cols fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.edit-cols legend { font-weight: 600; margin-bottom: 4px; }
.edit-cols .grid { grid-template-columns: 1fr 1.4fr; gap: 10px; }
@media (max-width: 900px) { .edit-cols { grid-template-columns: 1fr; } }
.btn[hidden] { display: none; }

/* Kundnummer */
.kundnr-badge { display: inline-block; margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; font-size: 15px; color: var(--navy); }
.kundnr-badge strong { letter-spacing: .06em; margin-left: 4px; color: var(--navy); font-size: 17px; }
.kundnr-tag { display: inline-block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }

/* Försäljningsstatistik */
.stat-head { padding-bottom: 14px; }
.stat-head h2 { margin: 0 0 2px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; }
.stat-tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-tile .stat-label { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.stat-tile .stat-big { font-size: 25px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat-tile .stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.delta { font-weight: 600; }
.delta.up { color: #166534; }
.delta.down { color: #b4232a; }
.chart-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-top h3 { margin: 0; }
.chart-leg { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chart-leg .lk { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 10px; vertical-align: -1px; }
.chart-leg .lk-bar { background: var(--navy); }
.chart-leg .lk-proj { background: var(--sky); border: 1px solid var(--accent); }
.chart-leg .lk-avg { background: transparent; border: 0; border-top: 2px dashed var(--accent); border-radius: 0; height: 0; width: 14px; }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--navy); }
.chart .bar-now { fill: var(--navy); }
.chart .bar-proj { fill: var(--sky); stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 2; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .avg { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .gl { fill: var(--muted); font-size: 11px; }
.chart .ml { fill: var(--muted); font-size: 11px; }
.stat-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.stat-table th, .stat-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.stat-table th { color: var(--navy); font-weight: 600; }
.stat-table td.r, .stat-table th.r { text-align: right; }
.stat-table tr.now td { background: var(--sky); }
@media (max-width: 760px) {
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* LOT-spårning */
.lot-line { margin: 2px 0 0; font-size: 14px; color: var(--navy); }
.lot-search { display: flex; gap: 10px; margin: 14px 0 4px; max-width: 480px; }
.lot-search input { flex: 1; }
.lot-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.lot-chip { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px; font-size: 13px; color: var(--navy); text-decoration: none; }
.lot-chip:hover { border-color: var(--accent); }
.lot-chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.lot-chip.on .muted { color: #bcd3e8 !important; }
.lot-table td { vertical-align: top; }

@media print {
  .site-header, .site-footer, .hero, .tabs, .lot-search, .lot-chips, [data-print], form.note-form { display: none !important; }
  .card { border: 0; box-shadow: none; padding: 0; }
  body { background: #fff; }
  .lot-table th, .lot-table td { padding: 5px 8px; font-size: 12px; }
}

/* LOT: knapprad och exportknapp */
.lot-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media print { .lot-export, .lot-actions { display: none !important; } }
