/* ═══════════════════════════════════════════════════════════════════════════
   Elkjøp CalMAN 3 — hvitt Elkjøp-design med lyst / mørkt / system-tema
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Merkefarger */
  --brand: #041e42;          /* Elkjøp marineblå */
  --brand-2: #0b2d5c;
  --lime: #97c11f;
  --accent: #00843d;         /* Elkjøp grønn – kan overstyres i Innstillinger */
  --accent-600: color-mix(in srgb, var(--accent) 84%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --accent-text: var(--accent);
  --sale: #d4002a;

  /* Flater – hvitt */
  --bg: #f4f5f7;
  --bg-elev: #ffffff;
  --bg-sunk: #f1f3f6;
  --bg-hover: #f2f4f7;
  --bg-input: #ffffff;
  --header-bg: #ffffff;
  --border: #e3e6eb;
  --border-strong: #cdd2da;

  /* Tekst */
  --text: #041e42;
  --text-2: #4a5872;
  --text-3: #7f899c;
  --on-accent: #ffffff;

  /* Status */
  --green: #00843d; --green-soft: #e3f4ea;
  --red: #d4002a; --red-soft: #fde7eb;
  --amber: #c46a00; --amber-soft: #fff2db;
  --blue: #0061c9; --blue-soft: #e3effc;
  --purple: #7a3fd1; --purple-soft: #f0e9fc;
  --gray-soft: #eef0f3;

  --shadow-sm: 0 1px 2px rgba(4, 30, 66, .05);
  --shadow: 0 2px 6px rgba(4, 30, 66, .06), 0 8px 24px rgba(4, 30, 66, .06);
  --shadow-lg: 0 16px 48px rgba(4, 30, 66, .18);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);

  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 76px;
  --wrap: 1440px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'DM Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --brand: #e9eef7;
  --brand-2: #c9d4e8;
  --accent-600: color-mix(in srgb, var(--accent) 80%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 20%, transparent);
  --accent-text: color-mix(in srgb, var(--accent) 60%, #fff);

  --bg: #0a0f19;
  --bg-elev: #111826;
  --bg-sunk: #0d131f;
  --bg-hover: #182234;
  --bg-input: #0d131f;
  --header-bg: #111826;
  --border: #1f2a3d;
  --border-strong: #2d3b53;

  --text: #e9eef7;
  --text-2: #a5b0c4;
  --text-3: #6f7b91;

  --green: #3ccf7e; --green-soft: rgba(60, 207, 126, .13);
  --red: #ff5c75; --red-soft: rgba(255, 92, 117, .13);
  --amber: #ffb547; --amber-soft: rgba(255, 181, 71, .13);
  --blue: #5ea8ff; --blue-soft: rgba(94, 168, 255, .14);
  --purple: #b48cff; --purple-soft: rgba(180, 140, 255, .14);
  --gray-soft: #1a2333;
  --sale: #ff5c75;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); font-size: 14.5px; line-height: 1.5; letter-spacing: -.005em;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
  transition: background-color .2s ease, color .2s ease;
}
body.modal-open { overflow: hidden; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 750; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 .6em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.ico { flex-shrink: 0; display: inline-block; vertical-align: middle; }
::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mobile-only { display: none !important; }
.spacer { flex: 1; }

/* ── Header (hvit) ────────────────────────────────────────────────────────── */
.shell { display: flex; flex-direction: column; min-height: 100vh; }
.e-header { position: sticky; top: 0; z-index: 40; background: var(--header-bg); border-bottom: 1px solid var(--border); transition: box-shadow .2s; }
.e-header.scrolled { box-shadow: 0 4px 18px rgba(4, 30, 66, .07); }
:root[data-theme='dark'] .e-header.scrolled { box-shadow: 0 4px 18px rgba(0, 0, 0, .45); }
.e-header-inner { max-width: var(--wrap); margin: 0 auto; height: var(--header-h); display: flex; align-items: center; gap: 28px; padding: 0 28px; }

.e-logo { display: flex; align-items: center; gap: 10px; color: var(--brand); flex-shrink: 0; }
.e-logo img { height: 34px; width: auto; }
.e-wordmark { font-weight: 900; font-size: 26px; letter-spacing: -.01em; line-height: 1; color: var(--brand); }
.e-product { display: flex; flex-direction: column; border-left: 1px solid var(--border-strong); padding-left: 12px; margin-left: 4px; line-height: 1.15; }
.e-product b { font-size: 14px; font-weight: 800; color: var(--text); }
.e-product small { font-size: 11.5px; color: var(--text-3); font-weight: 500; }

.e-search { flex: 1; max-width: 680px; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 6px 0 20px; border-radius: 999px; background: var(--bg-sunk); color: var(--text-3); border: 1.5px solid transparent; font: inherit; font-size: 15px; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.e-search:hover { border-color: var(--border-strong); background: var(--bg-elev); }
.e-search .e-search-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e-search kbd { background: var(--bg-elev); }
.e-search .e-search-btn { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }

.e-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.e-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 58px; height: 56px; padding: 0 8px; border-radius: 10px; color: var(--text); background: transparent; border: 0; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; position: relative; transition: background .12s, color .12s; }
.e-action:hover { background: var(--bg-hover); color: var(--accent-text); }
.e-action .ico { width: 23px; height: 23px; }
.e-action .count { position: absolute; top: 4px; right: 8px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 800; min-width: 19px; height: 19px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--header-bg); }
.e-action .count.warn { background: var(--red); color: #fff; }
.e-user { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 999px; color: var(--text); cursor: pointer; border: 1px solid var(--border); margin-left: 8px; transition: background .12s, border-color .12s; }
.e-user:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.e-user .meta { line-height: 1.15; }
.e-user .meta b { display: block; font-size: 13.5px; font-weight: 700; }
.e-user .meta span { font-size: 11.5px; color: var(--text-3); }

/* Kategorimeny */
.e-nav { background: var(--header-bg); border-bottom: 1px solid var(--border); }
.e-nav-inner { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; gap: 4px; padding: 0 18px; overflow-x: auto; scrollbar-width: none; }
.e-nav-inner::-webkit-scrollbar { display: none; }
.e-nav a { display: flex; align-items: center; gap: 8px; padding: 14px 12px 12px; color: var(--text); font-weight: 650; font-size: 14px; white-space: nowrap; border-bottom: 3px solid transparent; transition: color .12s, border-color .12s; }
.e-nav a .ico { width: 18px; height: 18px; color: var(--text-3); transition: color .12s; }
.e-nav a:hover { color: var(--accent-text); }
.e-nav a:hover .ico, .e-nav a.active .ico { color: var(--accent-text); }
.e-nav a.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.e-nav .count { background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.e-nav .count.warn { background: var(--red); color: #fff; }
.e-nav .sep { width: 1px; height: 22px; background: var(--border); margin: 0 8px; flex-shrink: 0; }
.e-nav .presence { margin-left: auto; padding-left: 16px; }

.presence { display: flex; align-items: center; }
.presence .avatar { border: 2px solid var(--header-bg); margin-left: -8px; }
.presence .more { font-size: 12px; color: var(--text-3); margin-left: 6px; }

.impersonate-bar { background: var(--amber); color: #111; padding: 8px 28px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 13.5px; }
.impersonate-bar button { margin-left: auto; }

/* Mobil-skuff */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 290px; max-width: 86vw; background: var(--bg-elev); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 60; transform: translateX(-100%); transition: transform .22s ease, visibility .22s; visibility: hidden; }
.sidebar.open { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
.sidebar-overlay { position: fixed; inset: 0; background: rgba(4, 12, 28, .45); z-index: 55; animation: fade .15s ease; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px; border-bottom: 1px solid var(--border); }
.sidebar .brand img { height: 28px; }
.sidebar .brand .e-wordmark { font-size: 21px; }
.nav { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--text); font-weight: 600; }
.nav a .ico { color: var(--text-3); }
.nav a:hover { background: var(--bg-hover); }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav a.active .ico { color: var(--accent-text); }
.nav .count { margin-left: auto; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.nav .count.warn { background: var(--red); color: #fff; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--border); }

/* ── Innhold ──────────────────────────────────────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; max-width: var(--wrap); width: 100%; margin: 0 auto; padding: 12px 28px 56px; }

.banner { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); margin: 10px 0 4px; border: 1px solid; color: var(--text); }
.banner > .ico { margin-top: 1px; }
.banner h4 { font-size: 14.5px; font-weight: 700; margin-bottom: 2px; }
.banner p { margin: 0; white-space: pre-line; color: var(--text-2); }
.banner .icon-btn { margin-left: auto; }
.banner-blue { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 28%, transparent); }
.banner-blue > .ico { color: var(--blue); }
.banner-green { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 28%, transparent); }
.banner-green > .ico { color: var(--green); }
.banner-yellow { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.banner-yellow > .ico { color: var(--amber); }
.banner-red { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 28%, transparent); }
.banner-red > .ico { color: var(--red); }
.banner-purple { background: var(--purple-soft); border-color: color-mix(in srgb, var(--purple) 28%, transparent); }
.banner-purple > .ico { color: var(--purple); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 20px 0 22px; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin: 18px 0 16px; padding: 34px 36px; border-radius: 18px; background: var(--bg-elev); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); }
.hero::before { content: ''; position: absolute; inset: 0 0 0 auto; width: 60%; background: url('/img/butikk.jpg') center 40% / cover; -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.5) 40%, #000 100%); mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.5) 40%, #000 100%); }
.hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(500px 220px at 0% 0%, color-mix(in srgb, var(--lime) 16%, transparent), transparent 70%), linear-gradient(90deg, var(--bg-elev) 30%, transparent 75%); pointer-events: none; }
:root[data-theme='dark'] .hero::before { opacity: .5; }
.hero > * { position: relative; z-index: 1; }
.hero-text { max-width: 560px; flex: 1; min-width: 260px; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-2); background: var(--bg-sunk); border: 1px solid var(--border); padding: 4px 11px; border-radius: 99px; margin-bottom: 14px; }
.hero h1 { font-size: 34px; font-weight: 900; letter-spacing: -.035em; }
.hero p { margin: 8px 0 0; color: var(--text-2); font-size: 15.5px; font-weight: 500; }
.hero-search { margin-top: 20px; display: flex; align-items: center; gap: 10px; width: 100%; max-width: 460px; height: 50px; padding: 0 10px 0 16px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--bg-elev); color: var(--text-3); font: inherit; font-size: 15px; cursor: pointer; text-align: left; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.hero-search span { flex: 1; }
.hero-search .ico { color: var(--accent-text); }
.hero-search:hover { border-color: var(--accent); box-shadow: var(--ring); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-actions .btn:not(.btn-primary) { background: var(--bg-elev); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); animation: pulse 2s infinite; display: inline-block; flex-shrink: 0; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.txt-red { color: var(--red); }

/* Snarveisfliser */
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; color: var(--text); transition: transform .18s, box-shadow .18s, border-color .18s; position: relative; min-width: 0; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.tile-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; transition: transform .2s; }
.tile:hover .tile-icon { transform: scale(1.08) rotate(-4deg); }
.tile-text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.tile-text b { font-size: 14px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-text small { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-arrow { color: var(--text-3); opacity: 0; transform: translateX(-4px); transition: opacity .15s, transform .15s; }
.tile:hover .tile-arrow { opacity: 1; transform: none; color: var(--accent-text); }
.tile-accent .tile-icon { background: var(--accent-soft); color: var(--accent-text); }
.tile-blue .tile-icon { background: var(--blue-soft); color: var(--blue); }
.tile-navy .tile-icon { background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--brand); }
.tile-purple .tile-icon { background: var(--purple-soft); color: var(--purple); }
.tile-amber .tile-icon { background: var(--amber-soft); color: var(--amber); }
.tile-green .tile-icon { background: var(--green-soft); color: var(--green); }
.count-pill { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; vertical-align: 1px; }

/* ── Kort / grid ──────────────────────────────────────────────────────────── */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 22px 0; }
.card-head h3 { display: flex; align-items: center; gap: 9px; }
.card-head h3 .ico { color: var(--accent-text); }
.card-head a { font-size: 13px; font-weight: 700; }
.card-body { padding: 14px 22px 20px; }
.grid { display: grid; gap: 16px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }

.stat { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: inherit; transition: transform .18s, box-shadow .18s, border-color .18s; }
.stat-link:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon .ico { width: 21px; height: 21px; }
.stat-body { position: relative; z-index: 1; }
.stat-value { font-size: 30px; font-weight: 850; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text); font-size: 13.5px; font-weight: 700; margin-top: 6px; }
.stat-sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.stat-spark { position: absolute; right: 0; bottom: 0; width: 55%; height: 46px; opacity: .9; pointer-events: none; }
.stat-spark .spark { width: 100%; height: 100%; }
.stat.has-spark .stat-sub { max-width: 52%; }
.stat-accent .stat-icon { background: var(--accent-soft); color: var(--accent-text); }
.stat-green .stat-icon { background: var(--green-soft); color: var(--green); }
.stat-red .stat-icon { background: var(--red-soft); color: var(--red); }
.stat-amber .stat-icon { background: var(--amber-soft); color: var(--amber); }
.stat-blue .stat-icon { background: var(--blue-soft); color: var(--blue); }
.stat-purple .stat-icon { background: var(--purple-soft); color: var(--purple); }

/* ── Knapper ──────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); background: var(--bg-elev); color: var(--text); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s, color .12s, transform .05s; }
.btn:hover { border-color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-600); border-color: var(--accent-600); color: var(--on-accent); }
.btn-dark { background: #041e42; border-color: #041e42; color: #fff; }
.btn-dark:hover { background: #0b2d5c; border-color: #0b2d5c; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.93); border-color: var(--red); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(.93); border-color: var(--green); }
:root[data-theme='dark'] .btn-success, :root[data-theme='dark'] .btn-danger { color: #08111f; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-hover); border-color: transparent; }
.btn-sm { min-height: 30px; padding: 4px 11px; font-size: 12.5px; border-radius: 7px; border-width: 1px; }
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 15.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; flex-shrink: 0; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.on { color: var(--amber); }
.icon-btn.danger:hover { color: var(--red); background: var(--red-soft); }
.icon-btn-sm { width: 28px; height: 28px; }

/* ── Skjema ───────────────────────────────────────────────────────────────── */
.input, .select, textarea.input { width: 100%; min-height: 40px; padding: 9px 12px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-input); color: var(--text); font: inherit; font-size: 14px; transition: border-color .12s, box-shadow .12s; }
.input:hover, .select:hover { border-color: var(--text-3); }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder { color: var(--text-3); }
textarea.input { resize: vertical; min-height: 84px; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f899c' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-icon { position: relative; }
.input-icon > .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.input-lg { min-height: 50px; padding: 13px 14px; font-size: 16px; border-radius: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 700; color: var(--text); }
.field .hint { color: var(--text-3); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
input[type='checkbox'] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

.segmented { display: inline-flex; background: var(--bg-sunk); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 650; font-size: 13px; padding: 6px 13px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.toggle input { display: none; }
.toggle-track { width: 40px; height: 23px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .15s; flex-shrink: 0; }
.toggle-thumb { position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(17px); }

/* ── Badges / avatar ──────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge .ico { width: 12px; height: 12px; }
.badge-gray { background: var(--gray-soft); color: var(--text-2); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0; letter-spacing: .02em; }
kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; color: var(--text-2); background: var(--bg-sunk); }

/* ── Verktøylinje / filtre ────────────────────────────────────────────────── */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.toolbar .input-icon { flex: 1; min-width: 220px; }
.toolbar .select { width: auto; min-width: 150px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--bg-elev); color: var(--text); font: inherit; font-size: 13px; font-weight: 650; cursor: pointer; transition: border-color .12s, background .12s; }
.chip:hover { border-color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--bg-elev); }
.chip .n { opacity: .65; font-weight: 500; }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--accent-soft); border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13.5px; flex-wrap: wrap; }

/* ── Tabeller ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-sunk); position: sticky; top: 0; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .check { width: 38px; }
.table tr.selected { background: var(--accent-soft) !important; }
.table tr.clickable { cursor: pointer; }
.cell-title { font-weight: 700; }
.cell-sub { font-size: 12.5px; color: var(--text-3); }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty-pill { min-width: 36px; text-align: center; padding: 3px 9px; border-radius: 7px; font-weight: 800; background: var(--gray-soft); font-variant-numeric: tabular-nums; }
.qty-pill.low { background: var(--amber-soft); color: var(--amber); }
.qty-pill.out { background: var(--red-soft); color: var(--red); }

/* ── Lister ───────────────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .sub { font-size: 12.5px; color: var(--text-3); }
a.list-item:hover .title { color: var(--accent-text); }
.rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--gray-soft); color: var(--text-2); }
.rank-1 { background: #ffe08a; color: #7a4b00; }
.rank-2 { background: #e2e6ec; color: #3a4558; }
.rank-3 { background: #ffd2b0; color: #8a3a0b; }

/* ── Kalibreringskort ─────────────────────────────────────────────────────── */
.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; padding: 18px; }
.kcard { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; position: relative; transition: box-shadow .15s, border-color .15s; }
.kcard:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.kcard.important { border-color: color-mix(in srgb, var(--red) 50%, var(--border)); box-shadow: 0 0 0 3px var(--red-soft); }
.kcard.claimed { border-left: 4px solid var(--blue); }
.kcard.selected { outline: 2px solid var(--accent); outline-offset: -1px; }
.kcard-top { display: flex; align-items: flex-start; gap: 10px; }
.kcard-title { font-weight: 800; font-size: 15.5px; line-height: 1.3; }
.kcard-brand { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--accent-text); }
.kcard-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.kcard-info { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.kcard-info dt { color: var(--text-3); }
.kcard-info dd { margin: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kcard-foot { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.kcard-foot .btn-success { flex: 1; }
.wait { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-3); }
.wait.late { color: var(--red); font-weight: 700; }

/* ── Grafer ───────────────────────────────────────────────────────────────── */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar-stack { width: 100%; max-width: 30px; border-bottom: 2px solid var(--border); display: flex; flex-direction: column-reverse; gap: 2px; flex: 1; justify-content: flex-start; }
.bar { width: 100%; border-radius: 5px 5px 2px 2px; transition: height .4s ease; }
.bar.cal { background: var(--accent); }
.bar.sold { background: #041e42; }
:root[data-theme='dark'] .bar.sold { background: #5ea8ff; }
.bar-label { font-size: 10.5px; color: var(--text-3); text-transform: capitalize; }
.bar-col.today .bar-label { color: var(--text); font-weight: 800; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbar { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 0; }
.hbar .lbl { width: 96px; flex-shrink: 0; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { flex: 1; height: 8px; background: var(--bg-sunk); border-radius: 99px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 99px; }
.hbar .val { width: 38px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
a.hbar:hover .lbl { color: var(--accent-text); }
.progress { height: 10px; background: var(--bg-sunk); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--lime)); border-radius: 99px; transition: width .4s ease; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 12, 28, .5); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fade .15s ease; }
.modal { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; animation: pop .18s ease; display: flex; flex-direction: column; max-height: 88vh; }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 580px; }
.modal-lg { max-width: 820px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 6px; }
.modal-head h3 { flex: 1; font-size: 18px; }
.modal-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.modal-body { padding: 12px 22px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--border); flex-wrap: wrap; background: var(--bg-sunk); border-radius: 0 0 16px 16px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ── Kommandopalett ───────────────────────────────────────────────────────── */
.palette { max-width: 640px; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.palette-input .ico { color: var(--accent-text); }
.palette-input input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--text); outline: none; }
.palette-results { max-height: 440px; overflow-y: auto; padding: 8px; }
.palette-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; font-weight: 550; }
.palette-item.active { background: var(--accent-soft); }
.palette-item.active .ico-box { background: var(--accent); color: var(--on-accent); }
.palette-item .ico-box { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-sunk); display: grid; place-items: center; color: var(--text-2); }
.palette-item .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }

/* ── Toasts ───────────────────────────────────────────────────────────────── */
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 10px; background: #041e42; color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .2s ease; min-width: 260px; }
:root[data-theme='dark'] .toast { background: #e9eef7; color: #041e42; }
.toast-success .ico { color: var(--lime); }
:root[data-theme='dark'] .toast-success .ico { color: #00843d; }
.toast-error, :root[data-theme='dark'] .toast-error { background: #d4002a; color: #fff; }
.toast-info .ico { color: #7fb8ff; }
.toast-action { margin-left: auto; background: transparent; border: 0; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }

/* ── Nedtrekk ─────────────────────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; vertical-align: middle; }
.sidebar-foot .dropdown { display: block; }
.dropdown-menu { position: absolute; top: calc(100% + 8px); min-width: 230px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; animation: pop .12s ease; color: var(--text); }
.dropdown-menu.align-right { right: 0; }
.dropdown-menu.align-left { left: 0; }
.dropdown-menu.align-up { bottom: calc(100% + 6px); top: auto; left: 0; right: 0; }
.dropdown-menu button, .dropdown-menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; border-radius: 8px; cursor: pointer; text-align: left; }
.dropdown-menu button:hover, .dropdown-menu a:hover { background: var(--bg-hover); }
.dropdown-menu button.selected { color: var(--accent-text); }
.dropdown-menu button .check-mark { margin-left: auto; color: var(--accent-text); }
.dropdown-menu .danger { color: var(--red); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.dropdown-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); padding: 8px 10px 4px; }

/* Temavelger */
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 2px 4px 4px; background: var(--bg-sunk); border: 1px solid var(--border); border-radius: 10px; }
.dropdown-menu .theme-switch button { flex-direction: column; gap: 3px; justify-content: center; padding: 7px 4px; font-size: 11.5px; color: var(--text-2); }
.dropdown-menu.sidebar-theme { position: static; box-shadow: none; border: 0; padding: 8px 0 0; animation: none; min-width: 0; background: transparent; }
.dropdown-menu.sidebar-theme .dropdown-label { padding: 8px 12px 6px; }
.dropdown-menu .theme-switch button.selected { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

/* ── Diverse ──────────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 52px 20px; color: var(--text-2); }
.empty-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; margin: 0 auto 14px; color: var(--accent-text); }
.empty-icon .ico { width: 26px; height: 26px; }
.empty h4 { color: var(--text); font-size: 16px; font-weight: 750; margin-bottom: 4px; }
.empty p { max-width: 380px; margin: 0 auto 14px; }
.loading { display: grid; place-items: center; padding: 64px; }
.spinner { display: inline-block; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-weight: 600; margin: 12px 0; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; border-top: 1px solid var(--border); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; font: inherit; font-weight: 700; color: var(--text-2); padding: 11px 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 16px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.product-preview { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-sunk); align-items: center; }
.product-preview img { width: 78px; height: 78px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; flex-shrink: 0; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 24px; text-align: center; color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { display: none; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 14px; }
.tl-item::before { content: ''; position: absolute; left: -19px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg-elev); border: 2px solid var(--accent); }
.tl-item .when { font-size: 12px; color: var(--text-3); }
.diff-pos { color: var(--green); font-weight: 800; }
.diff-neg { color: var(--red); font-weight: 800; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.e-price { color: var(--sale); font-weight: 850; }
.credit { font-size: 12.5px; color: var(--text-3); text-align: center; margin-top: 22px; }
.credit a { color: var(--text-2); font-weight: 700; }
.st-short { display: none; }

/* ── Footer (lys) ─────────────────────────────────────────────────────────── */
.e-footer { margin-top: auto; background: var(--bg-elev); border-top: 1px solid var(--border); color: var(--text-2); }
.e-footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 32px 28px 24px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.e-footer h5 { color: var(--text); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }
.e-footer a { color: var(--text-2); font-weight: 550; }
.e-footer a:hover { color: var(--accent-text); }
.e-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.e-footer-bottom { border-top: 1px solid var(--border); background: var(--bg-sunk); }
.e-footer-bottom > div { max-width: var(--wrap); margin: 0 auto; padding: 14px 28px; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--text-3); }
.fjordnett { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text) !important; }
.fjordnett-mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #1e88e5, #00c2a8); display: grid; place-items: center; font-weight: 900; font-size: 12px; color: #fff; }

/* ── Innlogging ───────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); background: var(--bg-elev); }
.auth-main { display: flex; flex-direction: column; padding: 28px 40px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-center { flex: 1; display: grid; place-items: center; padding: 32px 0; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 32px; margin-bottom: 8px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; margin-top: 28px; }
.auth-side { position: relative; margin: 14px 14px 14px 0; border-radius: 20px; overflow: hidden; color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(180deg, rgba(4,30,66,.05) 0%, rgba(4,30,66,.55) 45%, rgba(4,30,66,.94) 100%), url('/img/butikk.jpg') 30% center / cover; }
.auth-side::after { content: ''; position: absolute; right: 36px; top: 36px; width: 46px; height: 98px; background: url('/img/elkjop-arrow.png') center / contain no-repeat; }
.auth-side > * { position: relative; }
.auth-side h2 { font-size: 34px; font-weight: 850; line-height: 1.12; max-width: 480px; color: #fff; }
.auth-side ul { list-style: none; padding: 0; margin: 24px 0 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; max-width: 560px; }
.auth-side li { display: flex; gap: 10px; align-items: center; font-weight: 550; font-size: 14px; }
.auth-side li .ico { color: var(--lime); }
.auth-side small { color: rgba(255,255,255,.75); }
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--brand); }
.auth-brand img { height: 38px; }
.auth-brand .e-wordmark { font-size: 28px; }
.auth-err { padding: 11px 13px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-weight: 600; font-size: 13.5px; }
.auth-ok { padding: 11px 13px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-weight: 600; font-size: 13.5px; }
.maint { min-height: 100vh; display: grid; place-items: center; padding: 20px; text-align: center; }
.maint .card { max-width: 480px; padding: 36px; }

/* ── PDA / skanner ────────────────────────────────────────────────────────── */
.pda { max-width: 580px; margin: 0 auto; }
.scan-box { padding: 20px; }
.scan-input { font-size: 22px; font-family: var(--mono); text-align: center; letter-spacing: .06em; padding: 16px; }
.scan-result { padding: 16px; border-radius: 14px; margin-top: 14px; display: flex; gap: 14px; align-items: center; animation: pop .2s ease; }
.scan-result.ok { background: var(--green-soft); }
.scan-result.err { background: var(--red-soft); color: var(--red); }
.scan-result img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 10px; }
.scan-big { font-size: 34px; font-weight: 850; font-variant-numeric: tabular-nums; }
.camera { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin-top: 12px; }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.camera .reticle { position: absolute; left: 10%; right: 10%; top: 38%; height: 24%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.flash-ok { animation: flashOk .5s ease; }
@keyframes flashOk { 0% { box-shadow: 0 0 0 0 var(--green); } 100% { box-shadow: 0 0 0 18px transparent; } }

/* Effekter */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.fx span { position: absolute; top: -20px; animation: fall linear infinite; opacity: .8; user-select: none; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); } }
:root:not([data-theme='dark']) .fx span { text-shadow: 0 0 2px rgba(4, 30, 66, .35); }

/* ── Bunnmeny (mobil) ─────────────────────────────────────────────────────── */
.bottom-nav { display: none; }

/* ═══ Nye komponenter ═════════════════════════════════════════════════════ */
/* Verktøystripe over header */
.e-util { background: var(--bg-sunk); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.e-util-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; height: 32px; display: flex; align-items: center; gap: 20px; }
.e-util-inner > *, .e-util button { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.e-util .ico { color: var(--accent-text); }
.e-util a { color: var(--text-2); }
.e-util a:hover, .e-util button:hover { color: var(--accent-text); }
.e-util button { border: 0; background: none; color: inherit; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.e-util kbd { font-size: 10px; padding: 0 5px; }

/* Brødsmuler */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-3); margin-bottom: 8px; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--accent-text); }

/* Sideinngang-animasjon */
.content > * { animation: rise .35s cubic-bezier(.2, .7, .2, 1) both; }
.content > *:nth-child(2) { animation-delay: .03s; } .content > *:nth-child(3) { animation-delay: .06s; } .content > *:nth-child(4) { animation-delay: .09s; } .content > *:nth-child(5) { animation-delay: .12s; } .content > *:nth-child(n+6) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.btn-on { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.btn.is-soft { opacity: .85; }

/* Endringsindikator */
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; padding: 2px 7px 2px 5px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.delta.up { background: var(--green-soft); color: var(--green); }
.delta.down { background: var(--red-soft); color: var(--red); }
.delta.flat { background: var(--gray-soft); color: var(--text-2); }

/* Arealdiagram */
.achart { position: relative; width: 100%; }
.achart svg { display: block; width: 100%; overflow: visible; cursor: crosshair; }
.achart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.achart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.achart .hover-line { stroke: var(--text-3); stroke-width: 1; vector-effect: non-scaling-stroke; }
.achart-dots { position: absolute; inset: 0; pointer-events: none; }
.achart-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid var(--bg-elev); transform: translate(-50%, -50%); box-shadow: var(--shadow-sm); }
.achart-tip { position: absolute; top: 4px; transform: translateX(14px); background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 9px 12px; font-size: 12.5px; pointer-events: none; min-width: 150px; z-index: 2; }
.achart-tip.left { transform: translateX(calc(-100% - 14px)); }
.achart-tip b { display: block; margin-bottom: 4px; text-transform: capitalize; }
.achart-tip div { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.achart-tip div span { margin-left: auto; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.achart-tip i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* Smultring */
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { position: relative; flex-shrink: 0; }
.donut svg circle { transition: stroke-dasharray .6s ease; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font-size: 24px; font-weight: 850; line-height: 1; letter-spacing: -.02em; }
.donut-center span { font-size: 11px; color: var(--text-3); font-weight: 600; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 140px; font-size: 13px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.donut-legend span { flex: 1; font-weight: 600; }
.donut-legend em { font-style: normal; color: var(--text-3); width: 38px; text-align: right; font-size: 12px; }

/* Stjerner */
.stars { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stars-bg { position: relative; color: var(--border-strong); letter-spacing: 1px; font-size: 15px; line-height: 1; }
.stars-fg { position: absolute; left: 0; top: 0; overflow: hidden; color: #f5a623; white-space: nowrap; }
.stars b { font-size: 13.5px; }

/* Skjelett-lasting */
.sk { display: flex; flex-direction: column; gap: 12px; }
.sk-line { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--bg-sunk) 0%, var(--bg-hover) 50%, var(--bg-sunk) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.sk-line:first-child { height: 20px; width: 40% !important; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Stolpelister */
.barlist { display: flex; flex-direction: column; gap: 4px; }
.barlist-row { display: grid; grid-template-columns: minmax(70px, 110px) 1fr auto; align-items: center; gap: 12px; padding: 6px 0; font-size: 13px; }
.barlist-lbl { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barlist-track { height: 10px; background: var(--bg-sunk); border-radius: 99px; overflow: hidden; }
.barlist-track > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s cubic-bezier(.2, .7, .2, 1); }
.barlist-row b { font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
a.barlist-row:hover .barlist-lbl { color: var(--accent-text); }

/* Pallen */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; padding-top: 6px; }
.podium-col { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; max-width: 110px; }
.podium-col b { font-size: 13px; }
.podium-step { width: 100%; border-radius: 10px 10px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; color: #3d2a00; }
.podium-step span { font-size: 20px; line-height: 1; }
.podium-step small { font-size: 11.5px; font-weight: 700; opacity: .75; }
.p1 .podium-step { height: 86px; background: linear-gradient(180deg, #ffd666, #f5b400); }
.p2 .podium-step { height: 62px; background: linear-gradient(180deg, #eef1f5, #c9d0da); color: #2a3445; }
.p3 .podium-step { height: 46px; background: linear-gradient(180deg, #ffd7b5, #e9a26b); color: #4a2306; }
.p1 .avatar { box-shadow: 0 0 0 3px #ffd666; }

/* KPI-kort (Innsikt) */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.kpi::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--kpi-c, var(--accent)); }
.kpi-accent { --kpi-c: var(--accent); } .kpi-blue { --kpi-c: var(--blue); } .kpi-navy { --kpi-c: var(--brand); } .kpi-amber { --kpi-c: var(--amber); }
.kpi-top { display: flex; align-items: center; gap: 10px; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--kpi-c) 12%, transparent); color: var(--kpi-c); }
.kpi-icon .ico { width: 18px; height: 18px; }
.kpi-label { font-weight: 700; font-size: 13.5px; flex: 1; }
.kpi-value { font-size: 32px; font-weight: 900; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.kpi-sub { font-size: 12.5px; color: var(--text-3); }
.insight-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); font-size: 13px; color: var(--text); }
.insight-note .ico { color: var(--amber); }

/* Kø-helse */
.queue-gauge { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qg-main { width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, var(--bg-elev) 78%, transparent 79% 100%), conic-gradient(var(--red) 0 var(--imp, 0%), var(--amber) var(--imp, 0%) 100%); flex-shrink: 0; }
.qg-main b { font-size: 32px; font-weight: 900; line-height: 1; }
.qg-main span { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.qg-stats { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; min-width: 200px; }
.qg-stats > div { display: flex; flex-direction: column; }
.qg-stats b { font-size: 16px; font-weight: 800; }

/* Varmekart */
.heat-grid { display: grid; gap: 3px; align-items: center; }
.heat-h { font-size: 10px; color: var(--text-3); text-align: left; height: 14px; }
.heat-d { font-size: 11px; font-weight: 700; color: var(--text-2); }
.heat-c { aspect-ratio: 1; border-radius: 4px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 100%), var(--bg-sunk)); transition: transform .1s; }
.heat-c:hover { transform: scale(1.25); outline: 1px solid var(--accent); }
.heat-scale { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 11px; color: var(--text-3); }
.heat-scale i { flex: 0 0 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--bg-sunk), var(--accent)); }

/* Toppliste */
.leader { display: flex; flex-direction: column; }
.leader-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.leader-row:last-child { border-bottom: 0; }
.leader-row .grow { flex: 1; min-width: 0; }
.leader-bar { height: 6px; background: var(--bg-sunk); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.leader-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--lime)); border-radius: 99px; }
.leader-total { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

/* ── Sammenligning ───────────────────────────────────────────────────────── */
.cmp-toggle.on { background: var(--accent); color: var(--on-accent); }
.cmp-toggle.on:hover { background: var(--accent-600); color: var(--on-accent); }
.cmp-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; cursor: pointer; color: var(--text-2); user-select: none; }
.cmp-check .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; background: var(--bg-elev); }
.cmp-check.on { color: var(--accent-text); }
.cmp-check.on .box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.cmp-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.cmp-hl { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); min-width: 0; }
.cmp-hl-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex-shrink: 0; }
.cmp-hl-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.cmp-hl-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-hl .grow { flex: 1; min-width: 0; }
.cmp-hl-val { font-size: 15px; font-weight: 850; white-space: nowrap; }

.cmp-card { overflow: hidden; }
.cmp-scroll { overflow-x: auto; }
.cmp-grid { display: grid; min-width: min-content; }
.cmp-sticky { position: sticky; top: 0; z-index: 3; background: var(--bg-elev); border-bottom: 1px solid var(--border); }
.cmp-label { position: sticky; left: 0; z-index: 2; background: var(--bg-elev); padding: 12px 16px 12px 20px; font-size: 13px; font-weight: 650; color: var(--text-2); display: flex; align-items: center; gap: 6px; border-right: 1px solid var(--border); }
.cmp-corner { flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 2px; padding-bottom: 20px; }
.cmp-corner b { font-size: 22px; color: var(--text); font-weight: 900; }
.cmp-legend { margin-top: 10px; font-size: 11.5px; color: var(--text-3); font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cmp-hint { width: 16px; height: 16px; border-radius: 50%; background: var(--bg-sunk); color: var(--text-3); font-size: 10.5px; font-weight: 800; display: inline-grid; place-items: center; cursor: help; }
.cmp-head { position: relative; padding: 20px 18px 18px; display: flex; flex-direction: column; gap: 6px; border-right: 1px solid var(--border); min-width: 0; }
.cmp-head:last-child { border-right: 0; }
.cmp-remove { position: absolute; right: 10px; top: 10px; z-index: 2; background: var(--bg-sunk); }
.cmp-ribbon { position: absolute; left: 14px; top: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 6px; background: linear-gradient(135deg, #ffd666, #f5b400); color: #3d2a00; font-size: 11px; font-weight: 800; box-shadow: 0 2px 8px rgba(245, 180, 0, .35); }
.cmp-img { height: 140px; display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 6px; color: #b0b8c6; border: 1px solid var(--border); }
.cmp-img.noimg { background: var(--bg-sunk); color: var(--text-3); }
.cmp-img img { max-width: 100%; max-height: 116px; object-fit: contain; transition: transform .3s; }
.cmp-head:hover .cmp-img img { transform: scale(1.04); }
.cmp-brand { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--accent-text); }
.cmp-title { font-weight: 800; font-size: 15.5px; line-height: 1.25; min-height: 2.5em; }
.cmp-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip-sm { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 6px; background: var(--bg-sunk); border: 1px solid var(--border); color: var(--text-2); }
.cmp-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 6px; min-height: 34px; }
.price { font-size: 26px; font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.price.sale { color: var(--sale); }
.before { font-size: 12.5px; color: var(--text-3); text-decoration: line-through; }
.save-tag { display: inline-block; background: var(--sale); color: #fff; font-weight: 800; font-size: 12.5px; padding: 2px 8px; border-radius: 6px; }
.cmp-stock { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.stock-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.stock-dot.ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.cmp-actions { display: flex; gap: 6px; margin-top: 8px; }
.cmp-actions .btn:first-child { flex: 1; }
.cmp-slot { margin: 16px; border: 2px dashed var(--border-strong); border-radius: 14px; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px 16px; color: var(--text); font: inherit; cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.cmp-slot:hover { border-color: var(--accent); background: var(--accent-soft); }
.cmp-slot-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); margin-bottom: 6px; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .2s; }
.cmp-slot:hover .cmp-slot-icon { transform: scale(1.08) rotate(90deg); }
.cmp-section { border-top: 1px solid var(--border); }
.cmp-sec-head { position: sticky; left: 0; display: flex; align-items: center; gap: 9px; width: 100%; padding: 13px 20px; border: 0; background: var(--bg-sunk); color: var(--text); font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; text-align: left; }
.cmp-sec-head .ico { color: var(--accent-text); }
.cmp-sec-head:hover { background: var(--bg-hover); }
.cmp-row { border-top: 1px solid var(--border); }
.cmp-row:hover .cmp-cell, .cmp-row:hover .cmp-label { background: color-mix(in srgb, var(--bg-hover) 70%, var(--bg-elev)); }
.cmp-cell { padding: 12px 18px; border-right: 1px solid var(--border); font-size: 14px; min-width: 0; background: var(--bg-elev); transition: background .1s; }
.cmp-cell:last-child { border-right: 0; }
.cmp-val { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.cmp-cell.best { background: color-mix(in srgb, var(--green) 7%, var(--bg-elev)); }
.cmp-row:hover .cmp-cell.best { background: color-mix(in srgb, var(--green) 11%, var(--bg-elev)); }
.best-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--green); background: var(--green-soft); padding: 2px 7px; border-radius: 5px; }
.cmp-meter { height: 5px; background: var(--bg-sunk); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.cmp-meter span { display: block; height: 100%; background: var(--text-3); border-radius: 99px; transition: width .5s; }
.cmp-cell.best .cmp-meter span { background: var(--green); }
.cmp-bullets { margin: 0; padding-left: 16px; font-size: 13px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.cmp-empty { text-align: center; padding: 56px 24px; }
.cmp-empty h2 { margin-top: 22px; }
.cmp-empty p { max-width: 460px; margin: 8px auto 0; }
.cmp-empty-art { display: flex; justify-content: center; gap: 10px; }
.cmp-empty-art span { width: 64px; height: 84px; border-radius: 12px; border: 2px dashed var(--border-strong); background: var(--bg-sunk); }
.cmp-empty-art span:nth-child(2) { border-style: solid; border-color: var(--accent); background: var(--accent-soft); transform: translateY(-8px); }

/* Velger */
.pick-lookup { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 12px; border: 1.5px solid var(--accent); border-radius: 12px; background: var(--accent-soft); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pick-lookup .ico-box { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); flex-shrink: 0; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.pick-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pick-item:hover { background: var(--bg-hover); }
.pick-item .grow { flex: 1; min-width: 0; }
.pick-item .cell-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-img { width: 46px; height: 46px; border-radius: 10px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; color: #b0b8c6; }
.pick-img img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.pick-img.sm { width: 38px; height: 38px; border-radius: 8px; }
.pick-add { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); transition: background .12s, color .12s; }
.pick-item:hover .pick-add { background: var(--accent); color: var(--on-accent); }

/* Flytende sammenligningslinje */
.cmp-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 12px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 18px 50px rgba(4, 30, 66, .22), 0 0 0 1px rgba(4, 30, 66, .03); animation: barIn .3s cubic-bezier(.2, .8, .2, 1.1); max-width: calc(100vw - 32px); }
:root[data-theme='dark'] .cmp-bar { box-shadow: 0 18px 50px rgba(0, 0, 0, .6); }
@keyframes barIn { from { opacity: 0; transform: translate(-50%, 30px); } }
.cmp-bar.min { padding: 6px; }
.cmp-bar-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--accent-soft); color: var(--accent-text); font: inherit; font-weight: 800; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.cmp-bar-items { display: flex; gap: 8px; }
.cmp-bar-item { position: relative; display: flex; align-items: center; gap: 8px; width: 170px; height: 52px; padding: 6px 26px 6px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev); }
.cmp-bar-item.empty { width: 52px; padding: 0; justify-content: center; border-style: dashed; color: var(--text-3); background: var(--bg-sunk); }
.cmp-bar-img { width: 40px; height: 40px; border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; flex-shrink: 0; color: #b0b8c6; border: 1px solid var(--border); }
.cmp-bar-img img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.cmp-bar-name { min-width: 0; font-size: 12.5px; font-weight: 700; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cmp-bar-name small { display: block; font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.cmp-bar-x { position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--bg-sunk); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.cmp-bar-x:hover { background: var(--red); color: #fff; }
.cmp-bar-actions { display: flex; align-items: center; gap: 6px; }

/* Hurtigtaster */
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.shortcut { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.shortcut .keys { display: inline-flex; gap: 5px; align-items: center; }

/* Utskrift (sammenligning) */
@media print {
  .e-util, .e-header, .e-footer, .bottom-nav, .cmp-bar, .page-actions, .cmp-remove, .cmp-slot, .cmp-actions, .banner, .toasts { display: none !important; }
  body { background: #fff; }
  .content > * { animation: none; }
  .cmp-sticky, .cmp-label { position: static; }
}

/* ── Responsivt ───────────────────────────────────────────────────────────── */
@media (max-width: 1280px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-dash { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .e-header-inner { gap: 18px; }
  .e-product { display: none; }
}
@media (max-width: 860px) {
  :root { --header-h: auto; }
  .mobile-only { display: inline-grid !important; }
  .desktop-only { display: none !important; }
  .e-header-inner { flex-wrap: wrap; gap: 8px 6px; padding: 8px 12px 10px; }
  .e-logo img { height: 26px; }
  .e-wordmark { font-size: 21px; }
  .e-search { order: 5; flex-basis: 100%; max-width: none; height: 44px; padding-left: 16px; }
  .e-search .e-search-btn { width: 34px; height: 34px; }
  .e-action { min-width: 44px; height: 44px; padding: 0 6px; }
  .e-action .lbl, .e-user .meta { display: none; }
  .e-action .count { top: 0; right: 0; }
  .e-user { padding: 3px; border: 0; margin-left: 2px; }
  .e-nav { display: none; }
  .content { padding: 6px 14px 100px; }
  .impersonate-bar { padding: 8px 14px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .grid-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .stat-icon { width: 38px; height: 38px; }
  .stat-value { font-size: 23px; }
  h1 { font-size: 23px; }
  .hero { padding: 22px 20px 22px 24px; min-height: 0; }
  .hero::before { width: 100%; opacity: .14; -webkit-mask-image: none; mask-image: none; }
  :root[data-theme='dark'] .hero::before { opacity: .12; }
  .hero h1 { font-size: 24px; }
  .hero-search { display: none; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; gap: 10px; }
  .tile-icon { width: 36px; height: 36px; }
  .tile-arrow { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .kpi-foot .spark { display: none; }
  .stat-spark { display: none; }
  .stat.has-spark .stat-sub { max-width: none; }
  .stat-top .delta { font-size: 11px; }
  .shortcuts { grid-template-columns: 1fr; }
  .page-actions { width: 100%; }
  .page-actions .toggle { flex: 1 1 100%; }
  .cmp-highlights { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cmp-hl { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; }
  .cmp-hl-icon { width: 30px; height: 30px; }
  .cmp-hl-name { white-space: normal; font-size: 12.5px; }
  .cmp-bar { bottom: 78px; left: 12px; right: 12px; transform: none; justify-content: space-between; animation: none; }
  .cmp-bar-items { display: none; }
  .cmp-card { --cmp-label: 104px; --cmp-col: 172px; }
  .cmp-label { padding: 10px 8px 10px 12px; font-size: 12px; }
  .cmp-corner b { font-size: 18px; }
  .cmp-head { padding: 16px 12px 14px; }
  .cmp-img { height: 100px; }
  .cmp-img img { max-height: 80px; }
  .price { font-size: 21px; }
  .cmp-cell { padding: 10px 12px; font-size: 13px; }
  .kgrid { grid-template-columns: 1fr; padding: 12px; }
  .table .hide-sm { display: none; }
  .kv { grid-template-columns: 110px 1fr; }
  .toolbar { padding: 12px 14px; }
  .toolbar .select { flex: 1; }
  .card-head { padding: 16px 16px 0; }
  .card-body { padding: 12px 16px 16px; }
  .card-pad { padding: 16px; }
  .st-long { display: none; }
  .st-short { display: inline; }

  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { padding: 18px 20px; }
  .auth-card h1 { font-size: 27px; }

  .e-footer-inner { grid-template-columns: 1fr; gap: 20px; padding: 24px 16px 12px; }
  .e-footer-bottom > div { padding: 12px 16px 92px; }

  .bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; background: color-mix(in srgb, var(--bg-elev) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 650; color: var(--text-3); padding: 4px 0; position: relative; }
  .bottom-nav a.active { color: var(--accent-text); }
  .bottom-nav a.active::before { content: ''; position: absolute; top: -7px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
  .bottom-nav .count { position: absolute; top: 0; left: 55%; background: var(--red); color: #fff; font-size: 10px; font-weight: 800; padding: 0 5px; border-radius: 99px; }
  .toasts { bottom: 86px; right: 14px; left: 14px; }
  .toast { min-width: 0; }
}
@media (min-width: 861px) { .sidebar, .sidebar-overlay { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
