/* 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=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; }
