/* Trygghetsfikan säljverktyg. Ljus, kompakt CRM-stil med sidomeny. */
:root {
  --bg: #F4F5F7;          /* sidans bakgrund */
  --paper: #FFFFFF;       /* paneler, fält */
  --surface: #F7F8FA;     /* sekundära ytor */
  --ink: #1A2330;
  --muted: #6A7380;
  --line: #E2E5EA;
  --line-strong: #CDD2D9;
  --green: #23402F;       /* Trygghetsfikans gröna, huvudfärg */
  --green-dark: #1A3023;
  --green-soft: #E3EAE4;
  --on-green: #FFFFFF;
  --copper: #A8642A;
  --copper-soft: #FBF0E4;
  --ok: #2F6B45;
  --warn: #C2412D;
  --warn-soft: #FDECE8;
  --link: #2F6B45;
  --sidebar: #23402F;
  --sidebar-ink: #D3DED6;
  --sidebar-active: #2F5240;
  --display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --body: var(--display);
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161C; --paper: #1A2029; --surface: #202733; --ink: #E7EBF0; --muted: #98A2B0;
    --line: #2C3441; --line-strong: #3A4352; --green: #8DB79C; --green-dark: #7AA88B; --green-soft: #1F2A22;
    --on-green: #08110B; --copper: #E0A06A; --copper-soft: #2E2218; --ok: #8DC9A0; --warn: #F08A76;
    --warn-soft: #3A1F1A; --link: #A6CDB3; --sidebar: #16261C; --sidebar-ink: #B9C9BE; --sidebar-active: #22382A;
    --shadow: none; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
code { font-size: .85em; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 .25em; }

/* Sidomeny */
.has-sidebar { padding-left: 220px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 220px; background: var(--sidebar); color: var(--sidebar-ink);
  display: flex; flex-direction: column; z-index: 50; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .6rem; padding: 1rem 1rem 1.1rem; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: #F4F1E8; color: #23402F; display: grid;
  place-items: center; font-weight: 700; font-size: 1rem; }
.brand-text { font-weight: 600; font-size: 1rem; }
.sidenav { display: flex; flex-direction: column; gap: 2px; padding: 0 .6rem 1rem; }
.sidenav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 6px; color: var(--sidebar-ink);
  text-decoration: none; font-weight: 500; }
.sidenav a:hover { background: var(--sidebar-active); color: #fff; text-decoration: none; }
.sidenav a.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 #8DB79C; }
.sidenav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sidenav-sep { margin: 1rem .7rem .35rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #8FA697; }

/* Toppfält */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: 56px; padding: 0 1.5rem; background: var(--paper); border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1; max-width: 460px; margin: 0; }
.search svg { position: absolute; left: .7rem; top: 50%; width: 16px; height: 16px; transform: translateY(-50%);
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.topbar .search input { margin: 0; padding-left: 2.2rem; background: var(--surface); border-color: var(--line); border-radius: 999px; }
.userbox { display: flex; gap: .7rem; align-items: center; margin: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: var(--on-green); display: grid; place-items: center;
  font-weight: 600; font-size: .8rem; text-transform: uppercase; }
.userbox-name { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; }
.userbox-name small { font-weight: 400; color: var(--muted); font-size: .75rem; }

.page { max-width: 1280px; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }

@media (max-width: 900px) {
  .has-sidebar { padding-left: 0; }
  .sidebar { position: static; width: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidenav { flex-direction: row; padding: .4rem; }
  .sidenav a span, .brand-text, .sidenav-sep, .userbox-name { display: none; }
  .topbar { position: static; }
}

/* Paneler och layout */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.stack > * + * { margin-top: .9rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.login { max-width: 380px; margin: 5rem auto; }
.login h1 { font-size: 1.6rem; }

/* Formulär */
label { display: block; font-weight: 600; font-size: .82rem; color: var(--ink); }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; font-size: .9rem; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=search],
input[type=datetime-local], input[type=date], input[type=file], select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .5rem .7rem; font: inherit; font-weight: 400;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 6px;
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.inline-form { display: inline; margin: 0; }

/* Knappar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem .9rem;
  font: inherit; font-weight: 600; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--paper);
  color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: var(--surface); text-decoration: none; }
.btn.primary { background: var(--green); border-color: var(--green); color: var(--on-green); }
.btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.danger { background: var(--paper); border-color: var(--warn); color: var(--warn); }
.btn.danger:hover { background: var(--warn-soft); }
.btn.copper { background: var(--paper); border-color: var(--copper); color: var(--copper); }
.btn.copper:hover { background: var(--copper-soft); }
.btn.small { padding: .3rem .6rem; font-size: .82rem; }
.btn.big { padding: .75rem 1rem; font-size: .95rem; width: 100%; }
.btn[aria-disabled=true] { opacity: .5; pointer-events: none; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link); cursor: pointer; }
button.link:hover { text-decoration: underline; }

/* Tabeller */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600;
  background: var(--surface); }
tbody tr:last-child td { border-bottom: 0; }
tfoot th { background: var(--surface); color: var(--ink); border-top: 1px solid var(--line); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface); }
tr.locked td { opacity: .5; }
td.num, th.num { text-align: right; }
.card > table th:first-child, .card > table td:first-child { padding-left: 1.25rem; }
.card > table th:last-child, .card > table td:last-child { padding-right: 1.25rem; }
.card[style*="padding:0"] { overflow: hidden; }

/* Etiketter */
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 600;
  background: var(--green-soft); color: var(--green-dark); white-space: nowrap; text-decoration: none; }
a.badge:hover { text-decoration: none; filter: brightness(.97); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.copper { background: var(--copper-soft); color: var(--copper); }
.badge.muted { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.badge.pkg-guld { background: #F7E7B4; color: #6B4E00; }
.badge.pkg-silver { background: #E7EAEE; color: #39424C; }
.badge.pkg-brons { background: #F4DEC8; color: #6B3F17; }

/* Meddelanden */
.flash { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; border: 1px solid transparent; }
.flash.ok { background: var(--green-soft); color: var(--ok); border-color: #C6D5CA; }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: #F6C9BF; }
@media (prefers-color-scheme: dark) { .flash.ok, .flash.warn { border-color: transparent; } }

/* Flikar */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .55rem .9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-color: var(--green); font-weight: 600; }

/* Kundprofil */
.profile dl { display: grid; grid-template-columns: 8.5rem 1fr; gap: .45rem 1rem; margin: 0; }
.profile dt { color: var(--muted); }
.profile dd { margin: 0; }
.phone { font-size: 1.5rem; font-weight: 700; text-decoration: none; color: var(--ink); letter-spacing: .01em; }
.phone:hover { color: var(--green); text-decoration: none; }
.outcomes { display: grid; gap: .75rem; }
.outcome-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--paper); }
.outcome-group h3 { margin-bottom: .5rem; }
.packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .6rem; }
.package-choice { position: relative; }
.package-choice input { position: absolute; opacity: 0; }
.package-choice > span { display: block; padding: .75rem; border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer; font-weight: 400; }
.package-choice strong { display: block; font-size: 1rem; }
.package-choice input:checked + span { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 1px var(--green); }
.package-choice input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border: 0; }

.pagination { display: flex; gap: .5rem; margin-top: 1rem; list-style: none; padding: 0; }
.empty { padding: 2.5rem; text-align: center; color: var(--muted); }
pre { background: var(--surface) !important; }

/* Firande vid sälj */
.celebrate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(10, 14, 11, .72); animation: celebrate-in .3s ease-out; }
.celebrate.closing { opacity: 0; transition: opacity .25s; }
.celebrate canvas { position: absolute; inset: 0; pointer-events: auto; }
.celebrate-card { position: relative; text-align: center; background: var(--paper); color: var(--ink);
  border-radius: 18px; padding: 2rem 2.5rem; min-width: min(420px, 90vw); box-shadow: 0 20px 60px rgba(0,0,0,.4);
  border: 3px solid var(--copper); animation: celebrate-pop .6s cubic-bezier(.2, 1.6, .4, 1); }
.celebrate.pkg-guld .celebrate-card { border-color: #D4A017; }
.celebrate.pkg-silver .celebrate-card { border-color: #9AA4AB; }
.celebrate-kicker { font-family: var(--display); font-size: 3rem; font-weight: 800; line-height: 1; color: var(--green); }
.celebrate-package { display: inline-block; margin: .9rem 0 .5rem; padding: .3rem 1.1rem; border-radius: 999px;
  font-weight: 700; font-size: 1.3rem; letter-spacing: .04em; text-transform: uppercase; background: var(--copper-soft); color: #6B4522; }
.celebrate.pkg-guld .celebrate-package { background: linear-gradient(135deg, #FFE08A, #D4A017); color: #4A3500; }
.celebrate.pkg-silver .celebrate-package { background: linear-gradient(135deg, #FFFFFF, #AEB7BD); color: #2E3437; }
.celebrate.pkg-brons .celebrate-package { background: linear-gradient(135deg, #F4D3B0, #CD7F32); color: #3F260E; }
.celebrate-customer { font-size: 1.2rem; font-weight: 600; }
.celebrate-price { font-family: var(--display); font-size: 1.6rem; margin: .2rem 0 .6rem; }
.celebrate-today { color: var(--muted); margin-bottom: 1.25rem; }
@keyframes celebrate-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes celebrate-pop { 0% { transform: scale(.4) rotate(-6deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .celebrate, .celebrate-card { animation: none; } }

/* Notiser i sidan */
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 90; display: grid; gap: .75rem; max-width: min(360px, calc(100vw - 2rem)); }
.toast { background: var(--paper); border: 2px solid var(--copper); border-radius: var(--radius); padding: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); display: grid; gap: .5rem; animation: toast-in .3s ease-out; }
@keyframes toast-in { from { transform: translateY(1rem); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* Minikalender under Återkom senare */
.minical { border: 1px solid var(--line); border-radius: 8px; padding: .75rem; background: var(--surface); }
.minical-head { margin-bottom: .6rem; }
.minical-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; max-height: 260px; overflow-y: auto; }
.slot { font: inherit; font-size: .85rem; padding: .35rem 0; border-radius: 6px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); cursor: pointer; }
.slot.hour { font-weight: 600; }
.slot:hover:not(:disabled) { border-color: var(--green); }
.slot.selected { background: var(--green); border-color: var(--green); color: var(--on-green); }
.slot:disabled { cursor: not-allowed; }
.slot.past { opacity: .35; }
.slot.callback { background: var(--copper-soft); border-color: var(--copper); color: var(--copper); text-decoration: line-through; }
.slot.external { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); text-decoration: line-through; }
.minical-busy { grid-column: 1 / -1; list-style: none; padding: 0; margin: .5rem 0 0; }
.minical-busy li { padding: .15rem .4rem; border-left: 3px solid; margin-bottom: .2rem; }
.minical-busy li.callback { border-color: var(--copper); }
.minical-busy li.external { border-color: var(--warn); }
.minical-legend { display: flex; gap: .9rem; flex-wrap: wrap; margin-top: .6rem; align-items: center; }
.minical-legend .sw { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: -1px; border: 1px solid var(--line); background: var(--paper); }
.minical-legend .sw.callback { background: var(--copper-soft); border-color: var(--copper); }
.minical-legend .sw.external { background: var(--warn-soft); border-color: var(--warn); }
.minical-msg { color: var(--warn); margin-top: .4rem; }
.purchase { display: inline-flex; gap: .35rem; align-items: center; flex-wrap: wrap; }

/* Förnyelsekunder i ringlistan: guldmarkering till vänster */
tr.renewal td:first-child { box-shadow: inset 4px 0 0 #C9A227; }
tr.renewal a { font-weight: 600; }
.renewal-tag { display: inline-block; margin-right: .4rem; padding: .1rem .5rem; border-radius: 4px; font-size: .7rem;
  font-weight: 700; letter-spacing: .03em; text-transform: uppercase; background: #F7E7B4; color: #6B4E00; }
tr.group-head td { padding: .45rem .8rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--surface); }
tr.group-head td:first-child { padding-left: 1.25rem; }
tr.group-head.renewal td { color: #8A6A00; }
@media (prefers-color-scheme: dark) {
  .renewal-tag { background: #3A3115; color: #F5C542; }
  tr.group-head.renewal td { color: #E0B84A; }
}

/* Inloggning */
.login .card { padding: 1.5rem; }
.login-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.05rem; margin-bottom: 2rem; }
.login-brand .brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--green); color: var(--on-green); display: grid; place-items: center; }

/* Missad återkoppling */
.missed-group { border-color: var(--copper); }
.retry-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; }
.retry-options form { margin: 0; }
.retry-options .btn { width: 100%; flex-direction: column; gap: 0; padding: .55rem .5rem; }
.retry-options .btn small { font-weight: 400; color: var(--muted); font-size: .78rem; }

/* Valbara etiketter, t.ex. anledning vid nej */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { position: relative; font-weight: 400; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: .3rem .7rem; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-size: .85rem; }
.chip input:checked + span { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.decline-group { border-color: #F2C6BC; }
.other-outcomes { padding-top: .25rem; border-top: 1px dashed var(--line); }

/* Säljöversikt */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .75rem; }
.stat { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.1rem; }
.stat span { color: var(--muted); font-size: .8rem; }
.stat strong { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat small { color: var(--muted); font-size: .78rem; }
.progress-item { display: grid; gap: .35rem; }
.progress { height: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--green); border-radius: 999px; transition: width .4s; }
.progress-bar.done { background: #C9A227; }
tr.me td { background: var(--green-soft); }
td.rank { width: 2.5rem; color: var(--muted); font-weight: 700; }
.bar-row { display: grid; grid-template-columns: 11rem 1fr 2.5rem; gap: .75rem; align-items: center; }
.bar { height: 8px; background: var(--surface); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--warn); opacity: .75; border-radius: 999px; }

/* Aktivitetslogg */
table.changes { margin-top: .3rem; width: auto; }
table.changes td { padding: .15rem .6rem .15rem 0; border: 0; background: none; }
table.changes del { color: var(--warn); text-decoration: line-through; }

/* Pris med rabatt vid sälj */
.sale-price { padding: .45rem .7rem; border-radius: 6px; background: var(--green-soft); color: var(--ok); }
.sale-price:empty { display: none; }
.sale-price.problem { background: var(--warn-soft); color: var(--warn); }
input::placeholder { text-transform: none; }

/* Säljrutan till vänster på kundsidan */
.sale-card { border: 2px solid var(--green); box-shadow: 0 2px 8px rgba(35, 64, 47, .08); }

/* Heatmap: en grön färgskala, ljus = lite, mörk = mycket. Mörkt läge vänder ankaret. */
.heatmap-card { --hm0: #EEF2EF; --hm1: #CFE0D3; --hm2: #A7C8B0; --hm3: #78A886; --hm4: #4C8160; --hm5: #23402F; --hm-na: repeating-linear-gradient(45deg, #EEF2EF 0 4px, #DDE3DE 4px 8px); }
@media (prefers-color-scheme: dark) {
  .heatmap-card { --hm0: #1D2520; --hm1: #2B4434; --hm2: #3E6249; --hm3: #5E8A6C; --hm4: #8DB79C; --hm5: #CFE6D6; --hm-na: repeating-linear-gradient(45deg, #1D2520 0 4px, #26302A 4px 8px); }
}
.heatmap-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.25rem; align-items: stretch; }
@media (max-width: 1000px) { .heatmap-layout { grid-template-columns: 1fr; } }
.heatmap-grid { display: grid; gap: 4px; align-items: center; }
.hm-colhead { font-size: .72rem; color: var(--muted); text-align: left; white-space: nowrap; }
.hm-rowhead { font-size: .82rem; color: var(--ink); }
.hm-cell { height: 30px; border: 0; border-radius: 6px; padding: 0; cursor: pointer; background: var(--hm0); outline-offset: 2px; }
.hm-cell:hover { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--muted); }
.hm-cell.selected { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.hm-cell.now:not(.selected) { box-shadow: inset 0 0 0 2px var(--paper); }
.lv0 { background: var(--hm0); } .lv1 { background: var(--hm1); } .lv2 { background: var(--hm2); }
.lv3 { background: var(--hm3); } .lv4 { background: var(--hm4); } .lv5 { background: var(--hm5); }
.hm-cell.lv-1 { background: var(--hm-na); }
.heatmap-legend { margin: .9rem 0 0 3.25rem; }
.heatmap-scale { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 2px; }
.heatmap-scale span { flex: 1; }
.heatmap-detail { position: relative; border-radius: var(--radius); background: var(--surface); padding: 1.1rem 1.2rem; display: flex;
  flex-direction: column; gap: .35rem; border-left: 5px solid var(--hm3); }
.heatmap-detail.lv-border0 { border-left-color: var(--line-strong); } .heatmap-detail.lv-border1 { border-left-color: var(--hm1); }
.heatmap-detail.lv-border2 { border-left-color: var(--hm2); } .heatmap-detail.lv-border3 { border-left-color: var(--hm3); }
.heatmap-detail.lv-border4 { border-left-color: var(--hm4); } .heatmap-detail.lv-border5 { border-left-color: var(--hm5); }
.detail-head { display: flex; align-items: center; gap: .5rem; font-size: 1rem; }
.detail-head .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.detail-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--ink); }
.detail-nav { margin-top: auto; padding-top: .75rem; display: flex; gap: .35rem; align-items: center; }
.detail-nav .sep { width: 1px; height: 18px; background: var(--line); margin: 0 .25rem; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.segmented > * { padding: .3rem .65rem; font: inherit; font-size: .82rem; background: var(--paper); color: var(--muted); border: 0; cursor: pointer; text-decoration: none; }
.segmented > * + * { border-left: 1px solid var(--line-strong); }
.segmented > .active { background: var(--green-soft); color: var(--ink); font-weight: 600; }
.segmented > *:hover { text-decoration: none; color: var(--ink); }

/* Översikt: mål högst upp */
.goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.goal-block { border-radius: 12px; padding: 1.25rem 1.4rem; color: #F4F1E8;
  background: radial-gradient(120% 140% at 100% 0%, #2F5240 0%, #23402F 55%, #1A3023 100%); box-shadow: 0 6px 20px rgba(35, 64, 47, .18); }
.goal-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: #CFE0D3; margin-bottom: 1rem; }
.goal-title span { font-weight: 400; text-transform: none; letter-spacing: 0; color: #A7C8B0; }
.goal-items { display: grid; gap: 1.1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.goal { display: grid; grid-template-columns: 104px 1fr; gap: 1.1rem; align-items: center; }
.ring { --ring: #8DB79C; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--ring) var(--deg), rgba(255,255,255,.12) 0); transition: background .6s; }
.goal-done .ring { --ring: #E3B84C; box-shadow: 0 0 0 4px rgba(227, 184, 76, .25); }
.goal-ahead .ring { --ring: #A6DDB8; }
.goal-behind .ring { --ring: #E8C27A; }
.ring-inner { width: 80px; height: 80px; border-radius: 50%; background: #1E3727; display: grid; place-items: center; align-content: center; text-align: center; }
.ring-inner strong { font-size: 1.35rem; line-height: 1; color: #fff; }
.ring-inner span { font-size: .7rem; color: #A7C8B0; margin-top: .2rem; }
.goal-status { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .15rem .5rem; border-radius: 999px; background: rgba(255,255,255,.12); color: #CFE0D3; }
.goal-done .goal-status { background: #E3B84C; color: #2B2005; }
.goal-ahead .goal-status { background: rgba(166, 221, 184, .2); color: #A6DDB8; }
.goal-behind .goal-status { background: rgba(232, 194, 122, .18); color: #F0D49B; }
.goal-numbers { font-size: 1rem; color: #CFE0D3; margin: .35rem 0 .15rem; }
.goal-numbers strong { font-size: 1.6rem; color: #fff; }
.goal-text p { margin: 0; font-size: .88rem; color: #E1EAE3; line-height: 1.4; }
.goals-empty { margin-bottom: 1.5rem; border-style: dashed; }
.section-title { margin-top: .25rem; }
.dash-row { margin-top: 1.5rem; }
@media (max-width: 520px) { .goals { grid-template-columns: 1fr; } .goal { grid-template-columns: 84px 1fr; } .ring { width: 84px; height: 84px; } .ring-inner { width: 64px; height: 64px; } }
@media (prefers-reduced-motion: reduce) { .ring { transition: none; } }

/* Översikt: animationer när sidan visas */
@property --deg { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.ring { animation: ring-fill 1s cubic-bezier(.22, .9, .3, 1) both; }
@keyframes ring-fill { from { --deg: 0deg; } }
.goals, .stat-grid > .stat, .dash-row { animation: rise-in .45s ease-out both; }
.stat-grid > .stat:nth-child(2) { animation-delay: .04s; }
.stat-grid > .stat:nth-child(3) { animation-delay: .08s; }
.stat-grid > .stat:nth-child(4) { animation-delay: .12s; }
.stat-grid > .stat:nth-child(5) { animation-delay: .16s; }
.dash-row { animation-delay: .12s; }
.dash-row + .dash-row { animation-delay: .2s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .ring, .goals, .stat-grid > .stat, .dash-row { animation: none; }
}

/* Makulerade sälj */
.order-cancelled { opacity: .65; }
tr.order-cancelled td { text-decoration: none; }
.cancel-order summary { cursor: pointer; color: var(--warn); }

/* Paketknappar vid sälj: metallglans när de väljs */
.package-choice { --metal-a: #E9EDF0; --metal-b: #B9C1C8; --metal-c: #F7F9FA; --metal-ink: #2E3437; --metal-edge: #9AA4AB; }
.package-choice.pkg-guld { --metal-a: #FFE79A; --metal-b: #D4A017; --metal-c: #FFF6D2; --metal-ink: #4A3500; --metal-edge: #B8860B; }
.package-choice.pkg-silver { --metal-a: #F2F4F6; --metal-b: #AEB7BD; --metal-c: #FFFFFF; --metal-ink: #2E3437; --metal-edge: #8D979E; }
.package-choice.pkg-brons { --metal-a: #F4D3B0; --metal-b: #B8733A; --metal-c: #FCE9D6; --metal-ink: #3F230C; --metal-edge: #9C5B26; }
.package-choice > span { position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.package-choice:hover > span { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); border-color: var(--metal-edge); }
.package-choice input:checked + span {
  border-color: var(--metal-edge); color: var(--metal-ink);
  background: linear-gradient(135deg, var(--metal-c) 0%, var(--metal-a) 35%, var(--metal-b) 100%);
  box-shadow: 0 0 0 1px var(--metal-edge), 0 6px 18px color-mix(in srgb, var(--metal-b) 45%, transparent);
  animation: pkg-pop .35s cubic-bezier(.2, 1.6, .4, 1);
}
.package-choice input:checked + span .muted { color: color-mix(in srgb, var(--metal-ink) 70%, transparent); }
.package-choice input:checked + span::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.75) 48%, transparent 66%);
  transform: translateX(-120%); animation: pkg-shine .9s ease-out .1s;
}
@keyframes pkg-pop { 0% { transform: scale(.96); } 100% { transform: scale(1); } }
@keyframes pkg-shine { to { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) {
  .package-choice > span { transition: none; }
  .package-choice input:checked + span, .package-choice input:checked + span::after { animation: none; }
}

/* Bekräftelseruta */
.confirm-modal { border: 0; padding: 0; border-radius: 14px; width: min(440px, calc(100vw - 2rem)); background: var(--paper); color: var(--ink);
  box-shadow: 0 24px 60px rgba(16, 24, 40, .28); }
.confirm-modal[open] { animation: confirm-in .28s cubic-bezier(.2, 1.3, .4, 1); }
.confirm-modal::backdrop { background: rgba(20, 32, 25, .45); backdrop-filter: blur(3px); animation: fade-in .2s ease-out; }
.confirm-box { padding: 1.5rem 1.5rem 1.25rem; display: grid; gap: .75rem; margin: 0; }
.confirm-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); }
.confirm-icon::before { content: ''; width: 20px; height: 20px; background: var(--green);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8v5M12 16.5v.5'/%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8v5M12 16.5v.5'/%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3C/svg%3E") center/contain no-repeat; }
.is-danger .confirm-icon { background: var(--warn-soft); }
.is-danger .confirm-icon::before { background: var(--warn); }
.is-sale .confirm-icon { background: #F7E7B4; }
.is-sale .confirm-icon::before { background: #B8860B;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 21h8M12 17v4M7 4h10v5a5 5 0 0 1-10 0z'/%3E%3Cpath d='M17 5h3v2a3 3 0 0 1-3 3M7 5H4v2a3 3 0 0 0 3 3'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 21h8M12 17v4M7 4h10v5a5 5 0 0 1-10 0z'/%3E%3Cpath d='M17 5h3v2a3 3 0 0 1-3 3M7 5H4v2a3 3 0 0 0 3 3'/%3E%3C/svg%3E"); }
.confirm-title { margin: 0; font-size: 1.2rem; }
.confirm-body p { margin: 0; color: var(--muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.btn.danger-solid { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.danger-solid:hover { filter: brightness(.95); }
.confirm-sale { display: grid; gap: .6rem; }
.confirm-package > span { display: inline-block; padding: .5rem 1rem; border-radius: 8px; font-weight: 700; font-size: 1.05rem;
  color: var(--metal-ink); border: 1px solid var(--metal-edge);
  background: linear-gradient(135deg, var(--metal-c) 0%, var(--metal-a) 35%, var(--metal-b) 100%); }
.confirm-price { color: var(--ink) !important; font-weight: 600; }
.confirm-sale dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; margin: 0; font-size: .9rem; }
.confirm-sale dt { color: var(--muted); }
.confirm-sale dd { margin: 0; }
@keyframes confirm-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .confirm-modal[open], .confirm-modal::backdrop { animation: none; } }

/* Tvåfaktor */
.qr { display: grid; place-items: center; padding: .75rem; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.qr svg { display: block; margin: 0 auto; width: 200px; height: 200px; }
.steps { margin: 0; padding-left: 1.2rem; display: grid; gap: .3rem; }
.code-input { font-size: 1.4rem !important; letter-spacing: .25em; text-align: center; font-variant-numeric: tabular-nums; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; }
.recovery-codes code { font-size: .95rem; padding: .35rem .5rem; text-align: center; }

/* Listor */
.sharing-chips .chip input:checked + span { border-color: var(--green); background: var(--green-soft); color: var(--ink); }
.share-users { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .3rem .75rem; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
pre { max-width: 100%; overflow-x: auto; }

/* Dagens plan */
.today { margin-bottom: 1.5rem; }
.today-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.today-greeting { font-size: 1.6rem; margin: 0 0 .15rem; }
.btn.today-cta { width: auto; flex-direction: column; gap: 0; padding: .65rem 1.4rem; }
.today-cta span { font-weight: 400; font-size: .78rem; opacity: .85; }
.today-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1000px) { .today-grid { grid-template-columns: 1fr; } }
.today-list h3 { margin-bottom: .5rem; }
.todo { list-style: none; padding: 0; margin: 0; }
.todo-item { display: grid; grid-template-columns: 4.5rem 1fr auto; gap: .8rem; align-items: center; padding: .6rem .2rem; border-bottom: 1px solid var(--line); }
.todo-item:last-child { border-bottom: 0; }
.todo-item a { font-weight: 600; }
.todo-item .small { display: block; color: var(--muted); }
.todo-time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); font-size: .9rem; }
.todo-time.renew { color: #8A6A00; }
.todo-item.urgent { background: var(--warn-soft); border-radius: 6px; padding-left: .5rem; padding-right: .5rem; border-bottom-color: transparent; margin-bottom: 2px; }
.todo-item.urgent .todo-time { color: var(--warn); }
.todo-item.next { box-shadow: inset 3px 0 0 var(--green); padding-left: .6rem; }
.todo-more { padding: .5rem .2rem; }
.todo-empty { padding: 1rem .2rem; color: var(--muted); }
.today-side { display: grid; gap: 1rem; }
.today-stat { display: grid; gap: .2rem; }
.today-stat span { color: var(--muted); font-size: .8rem; }
.today-stat strong { font-size: 1.25rem; }
.today-stat small { color: var(--muted); font-size: .82rem; line-height: 1.4; }

/* ===== Översikt: Mina siffror och topplista ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mine { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: .75rem; }
@media (max-width: 900px) { .mine { grid-template-columns: minmax(0, 1fr); } }
.mine > .card { animation: rise-in .45s ease-out both; }
.mine > .card + .card { animation-delay: .08s; }

.funnel { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: .5rem; padding: 1.25rem 1.4rem 1rem; }
.funnel-step { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.funnel-step strong { font-size: 2.1rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.funnel-step.is-goal strong { color: var(--green); }
.funnel-label { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .8rem; font-weight: 500; }
.funnel-label svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.funnel-step.is-goal .funnel-label { color: var(--green); }
.funnel-arrow { display: flex; flex-direction: column; align-items: center; gap: .3rem; color: var(--muted); font-size: .75rem; font-weight: 600; min-width: 3.5rem; }
.funnel-arrow i { display: block; width: 100%; height: 2px; background: var(--line-strong); position: relative; border-radius: 2px; }
.funnel-arrow i::after { content: ''; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left-color: var(--line-strong); border-right: 0; }
.funnel-arrow span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .5rem; }
.funnel-hint { grid-column: 1 / -1; margin: .6rem 0 0; padding-top: .7rem; border-top: 1px dashed var(--line); color: var(--muted); }

.delta { font-weight: 600; white-space: nowrap; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--copper); }
.delta.same { color: var(--muted); }
.delta-label { color: var(--muted); }

.money { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem;
  background: linear-gradient(145deg, var(--green) 0%, var(--green-dark) 100%); color: var(--on-green); border: 0; position: relative; overflow: hidden; }
.money::after { content: ''; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.money strong { display: block; font-size: 2rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.money-label { font-size: .8rem; opacity: .8; }
.money .delta, .money .delta-label { color: inherit; opacity: .85; }
.money-commission { padding-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .15); }
.money-commission strong { font-size: 1.3rem; }

.leaderboard-head { padding: 1.1rem 1.25rem .6rem; }
.leaderboard td { vertical-align: middle; }
.leaderboard th.rank-col, .leaderboard td.rank-col { width: 3rem; text-align: center; padding-right: 0; }
.medal { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: .78rem; font-weight: 700; color: #3B2A08;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .12); }
.medal-1 { background: linear-gradient(145deg, #F6DE8D, #D4A73A); }
.medal-2 { background: linear-gradient(145deg, #EEF0F3, #B7BDC6); color: #2E3640; }
.medal-3 { background: linear-gradient(145deg, #F0C29A, #B9773F); color: #3A1F0B; }
.place { color: var(--muted); font-weight: 700; }
.seller { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: .75rem; font-weight: 700; }
tr.me .avatar { background: var(--green); color: var(--on-green); }
.seller-text { min-width: 0; flex: 1; }
.sales-pill { display: inline-block; min-width: 1.9rem; padding: .1rem .5rem; border-radius: 999px; background: var(--green); color: var(--on-green); font-weight: 700; text-align: center; }
.sales-pill.zero { background: var(--surface); color: var(--muted); }
.leaderboard tr.me td { background: color-mix(in srgb, var(--green-soft) 70%, transparent); }
.leaderboard tr.me td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.leaderboard-empty { margin: 0; padding: .8rem 1.25rem 1rem; border-top: 1px solid var(--line); }

.empty-note { display: flex; gap: .75rem; align-items: center; padding: .85rem 1rem; border-radius: var(--radius); background: var(--surface); }
.empty-note svg { flex: none; width: 28px; height: 28px; fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.leaderboard td.num, .leaderboard th.num { white-space: nowrap; }
.leaderboard .seller-text strong { white-space: nowrap; }

.board-stack { display: grid; gap: 1.5rem; }
.grid-2 > .nope { align-self: start; }
.nope { display: flex; flex-direction: column; gap: 1rem; }
.nope-total { text-align: right; }
.nope-total strong { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.nope-bar { display: flex; gap: 3px; height: 14px; border-radius: 999px; overflow: hidden; }
.nope-seg { min-width: 6px; transform-origin: left; animation: grow-x .6s ease-out both; }
@keyframes grow-x { from { transform: scaleX(0); } }
.nope-legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem .75rem; }
.nope-legend li { display: flex; align-items: center; gap: .55rem; padding: .55rem .75rem; border-radius: var(--radius); background: var(--surface); }
.nope-reason { flex: 1; min-width: 0; line-height: 1.3; }
.nope-n { white-space: nowrap; }
.nope-dot { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.nope-c0 { background: #C2412D; }
.nope-c1 { background: #D9822B; }
.nope-c2 { background: #E2B23E; }
.nope-c3 { background: #7E8FA3; }
.nope-c4 { background: #A9B4C2; }
.nope-c5 { background: #CDD3DB; }

@media (max-width: 640px) {
  .funnel { grid-template-columns: 1fr; }
  .funnel-arrow { flex-direction: row; min-width: 0; }
  .funnel-arrow i { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mine > .card, .nope-seg { animation: none; transition: none; }
}

/* ===== Säljgrupper ===== */
.team-blue { --team: #257de0; } .team-orange { --team: #f47230; } .team-aqua { --team: #00b894; }
.team-yellow { --team: #f2a600; } .team-magenta { --team: #ee7fac; } .team-green { --team: #008a17; }
@media (prefers-color-scheme: dark) {
  .team-blue { --team: #338ced; } .team-orange { --team: #e76624; } .team-aqua { --team: #00a888; }
  .team-yellow { --team: #d28e05; } .team-magenta { --team: #e24d8b; } .team-green { --team: #0aac23; }
}
.team-tag { display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  color: var(--ink); background: color-mix(in srgb, var(--team) 14%, transparent); white-space: nowrap; }
.team-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--team); }
.team-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--team); }
.team-list { display: grid; gap: .5rem; }
.team-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: var(--radius); }
.team-row input[type=text] { flex: 1; min-width: 160px; max-width: 280px; }
.team-row select { width: auto; }

/* ===== Försäljning (admin-hubb) ===== */
.hub-head { margin-bottom: 1rem; align-items: flex-start; }
.hub-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-bottom: 1.25rem; }
.hub-period { gap: .5rem; }
.hub-period strong { min-width: 11rem; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); font-size: .85rem; font-weight: 500; text-decoration: none; }
.chip:hover { border-color: var(--line-strong); text-decoration: none; }
.chip.active { background: var(--green); border-color: var(--green); color: var(--on-green); }
.chip .team-dot { width: 9px; height: 9px; }
.chip.active .team-dot { box-shadow: 0 0 0 2px var(--on-green); }

.hub-kpis { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 1100px) { .hub-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-hero { grid-column: 1 / -1; } }
.kpi { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.15rem; animation: rise-in .45s ease-out both; }
.kpi:nth-child(2) { animation-delay: .04s; } .kpi:nth-child(3) { animation-delay: .08s; } .kpi:nth-child(4) { animation-delay: .12s; } .kpi:nth-child(5) { animation-delay: .16s; }
.kpi-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.kpi strong { font-size: 1.7rem; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.kpi-hero { background: linear-gradient(145deg, var(--green) 0%, var(--green-dark) 100%); color: var(--on-green); border: 0; position: relative; overflow: hidden; }
.kpi-hero::after { content: ''; position: absolute; right: -40px; top: -50px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .06); }
.kpi-hero strong { font-size: 2.1rem; }
.kpi-hero .kpi-label, .kpi-hero .delta, .kpi-hero .delta-label { color: inherit; opacity: .85; }

.hub-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; margin: 1.25rem 0; }
.hub-grid.has-teams { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .hub-grid.has-teams { grid-template-columns: minmax(0, 1fr); } }
.hub-chart, .hub-teams { display: flex; flex-direction: column; gap: 1rem; }

.daychart { display: flex; align-items: stretch; gap: 6px; height: 200px; padding-top: .5rem; }
.daychart.is-month { gap: 3px; }
.day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: .35rem; position: relative; outline: none; }
.day-bar-wrap { flex: 1; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.day-bar { width: 100%; max-width: 48px; margin: 0 auto; background: var(--green); border-radius: 4px 4px 0 0; transform-origin: bottom; animation: grow-y .6s ease-out both; }
@keyframes grow-y { from { transform: scaleY(0); } }
.day.is-empty .day-bar-wrap::after { content: ''; display: block; width: 100%; max-width: 48px; margin: 0 auto; height: 2px; background: var(--line-strong); border-radius: 2px; }
.day.future .day-bar-wrap { border-bottom-style: dashed; }
.day.future .day-bar-wrap::after { background: transparent; }
.day-label { height: 1rem; text-align: center; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.day.today .day-label { color: var(--ink); font-weight: 700; }
.day:hover .day-bar, .day:focus .day-bar { background: var(--green-dark); }
.day-tip { position: absolute; bottom: calc(100% - .25rem); left: 50%; transform: translate(-50%, 4px); z-index: 5; pointer-events: none; opacity: 0;
  transition: opacity .12s, transform .12s; background: var(--ink); color: var(--paper); border-radius: 6px; padding: .4rem .6rem; font-size: .78rem; white-space: nowrap;
  display: flex; flex-direction: column; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.day:hover .day-tip, .day:focus .day-tip { opacity: 1; transform: translate(-50%, 0); }
.day.future .day-tip { display: none; }
.day:first-child .day-tip { left: 0; transform: translate(0, 4px); }
.day:first-child:hover .day-tip, .day:first-child:focus .day-tip { transform: translate(0, 0); }
.day:last-child .day-tip { left: auto; right: 0; transform: translate(0, 4px); }
.day:last-child:hover .day-tip, .day:last-child:focus .day-tip { transform: translate(0, 0); }

.team-none { --team: var(--line-strong); }
.team-cards { display: grid; gap: .6rem; }
.team-card { display: flex; flex-direction: column; gap: .55rem; padding: .8rem .9rem; border: 1px solid var(--line); border-left: 4px solid var(--team);
  border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color .12s, background .12s; }
.team-card:hover { text-decoration: none; background: var(--surface); }
.team-card.active { background: color-mix(in srgb, var(--team) 8%, var(--paper)); border-color: color-mix(in srgb, var(--team) 45%, var(--line)); }
.team-name { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.team-figures { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: .5rem; }
.team-figures strong { display: block; font-size: 1.05rem; }
.team-figures span { font-size: .75rem; color: var(--muted); }
.team-share { height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.team-share > div { height: 100%; background: var(--team); border-radius: 999px; }

.hub-sellers-head { padding: 1.1rem 1.25rem .9rem; gap: 1rem; flex-wrap: wrap; }
.hub-table td { vertical-align: middle; }
.hub-table th.rank-col, .hub-table td.rank-col { width: 3rem; text-align: center; padding-right: 0; }
.hub-table td.num, .hub-table th.num { white-space: nowrap; }
.hub-table tr.inactive .seller-text strong { color: var(--muted); }
.hub-table tr.clickable.open td { background: var(--surface); }
.hub-table tr.detail-row > td { background: var(--surface); padding-top: 0; }
.hub-table .seller-text strong { white-space: nowrap; }
.hub-table .seller-text .team-tag { margin-top: .2rem; }
.pkg-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.pkg-chip { padding: .05rem .45rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--surface); color: var(--ink); white-space: nowrap; }
.pkg-chip.pkg-guld { background: #F7E7B4; color: #6B4E00; }
.pkg-chip.pkg-silver { background: #E7EAEE; color: #39424C; }
.pkg-chip.pkg-brons { background: #F4DEC8; color: #6B3F17; }
@media (prefers-reduced-motion: reduce) { .kpi, .day-bar { animation: none; } }

/* ---------- Delningslänk på kundsidan ---------- */
.share-body { display: flex; gap: 1.25rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.share-main { flex: 1 1 280px; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.share-url { display: flex; gap: .5rem; }
.share-url input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }
.share-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.share-stats > div { display: flex; flex-direction: column; gap: .1rem; padding: .6rem .75rem; border-radius: 10px; background: var(--surface); }
.share-stats strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.share-qr { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.share-qr img { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.share-stats strong.share-when { font-size: 1rem; line-height: 1.75rem; }
