/* Modelljernbane Registrering – referanse-design (Gemini mockup) */

:root {

  /* Windows 11 Fluent – fargeskjema */
  --bg: #f3f3f3;
  --bg-card: #ffffff;
  --bg-subtle: #fafafa;
  --bg-control: #ffffff;
  --bg-control-hover: #f6f6f6;
  --bg-nav-active: #eaeaea;
  --border: #e5e5e5;
  --border-strong: #d1d1d1;
  --text: rgba(0, 0, 0, 0.9);
  --text-secondary: rgba(0, 0, 0, 0.61);
  --text-muted: rgba(0, 0, 0, 0.45);
  --header: #ffffff;
  --header-dark: #f9f9f9;
  --tab-bar: #f9f9f9;
  --navy: #005fb8;
  --accent: #005fb8;
  --accent-hover: #004e99;
  --accent-light: #e8f3ff;
  --accent-subtle: rgba(0, 95, 184, 0.08);
  --orange: #005fb8;
  --orange-hover: #004e99;
  --price-orange: #c2410c;
  --green: #0f7b0f;
  --green-hover: #0b5a0b;
  --danger: #c42b1c;
  --danger-hover: #a52618;
  --danger-bg: #fdf2f1;
  --success: #0f7b0f;
  --warning-bg: #fff8e6;
  --warning-text: #8a6116;
  --tag-blue-bg: #e8f3ff;
  --tag-blue-text: #005fb8;
  --tag-gray-bg: #f0f0f0;
  --tag-gray-text: rgba(0, 0, 0, 0.61);
  --radius: 4px;
  --radius-lg: 8px;
  --radius-win: 8px;
  --shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --font: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;

}



*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; }

html, body {

  margin: 0; padding: 0; min-height: 100vh;

  font-family: var(--font); background: var(--bg); color: var(--text);

  line-height: 1.5; -webkit-font-smoothing: antialiased;

}

a { color: var(--accent); }

.hidden { display: none !important; }



.boot-screen {

  min-height: 100vh; display: flex; align-items: center; justify-content: center;

  background: linear-gradient(180deg, #f9f9f9 0%, #f3f3f3 100%);

}

.boot-card { text-align: center; padding: 2rem; }

.boot-icon { font-size: 3.5rem; display: block; margin-bottom: 1rem; }

.boot-card p { color: var(--text-secondary); font-size: 1.1rem; }



.auth-screen {

  min-height: 100vh; display: flex; align-items: center; justify-content: center;

  padding: 2rem; background: var(--bg);

}

.auth-card, .onboarding-card {

  background: var(--bg-card); border: 1px solid var(--border);

  border-radius: var(--radius-lg); box-shadow: var(--shadow);

  padding: 2.5rem; width: 100%; max-width: 480px;

}

.auth-card h1, .onboarding-card h1 { margin: 0 0 0.5rem; font-size: 1.75rem; font-weight: 600; }

.auth-card p.sub, .onboarding-card p.sub { color: var(--text-secondary); margin: 0 0 1.25rem; }

.auth-storage-notice {
  margin: 0 0 1.1rem;
  padding: 0.75rem 0.85rem;
  background: var(--accent-subtle);
  border: 1px solid rgba(196, 92, 38, 0.22);
  border-radius: var(--radius);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.auth-storage-notice strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  color: var(--text);
}

.auth-storage-notice p { margin: 0 0 0.45rem; }
.auth-storage-notice p:last-child { margin-bottom: 0; }
.auth-tagline {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-secondary);
}

.app-credits {
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.app-credits a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.app-credits a:hover { opacity: 0.85; }

.app-credits-auth {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.app-credits-tagline {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.app-credits-copy,
.app-credits-support { margin: 0.25rem 0 0; }

.app-nav-footer {
  margin-top: auto;
  padding: 0.85rem 0.65rem 0.35rem;
  border-top: 1px solid var(--border);
}

.app-credits-nav-copy { margin: 0 0 0.2rem; }

.app-credits-nav-links {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.4;
  word-break: break-word;
}

.app-credits-nav-links a { font-weight: 600; }

.app-about-tagline {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.app-about-block {
  margin-top: 1rem;
}

.app-about-subhead {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.app-about-coming { color: var(--text-muted); }

.app-about-wish .btn { margin-top: 0.55rem; }

.app-about-features {
  margin: 0.75rem 0 1rem;
  padding-left: 1.15rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.app-about-meta {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.app-about-meta p { margin: 0.35rem 0 0; }

.auth-brand-text,
.boot-brand {
  margin: 0 0 0.75rem;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.15;
  text-align: center;
}

.boot-brand { margin-bottom: 0.35rem; }

.boot-loading {
  margin: 0;
  color: var(--text-secondary);
}

.auth-form label, .onboarding-form label {

  display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem;

  font-size: 0.95rem; color: var(--text-secondary); font-weight: 500;

}

.auth-form input, .auth-form select, .onboarding-form input, .onboarding-form select {

  padding: 0.75rem 1rem; font-size: 1rem; border: 1px solid var(--border-strong);

  border-radius: var(--radius); font-family: inherit; min-height: 44px;

}

.auth-switch { margin-top: 1.25rem; text-align: center; color: var(--text-secondary); }



.app-shell { min-height: 100vh; display: flex; flex-direction: column; }



.app-topbar {

  background: var(--header); color: var(--text);

  display: flex; align-items: center; justify-content: space-between;

  padding: 0.65rem 1.25rem; gap: 1rem; flex-wrap: wrap;

  border-bottom: 1px solid var(--border);

  box-shadow: var(--shadow-sm);

}

.topbar-brand { display: flex; align-items: center; min-width: 0; flex-shrink: 0; }

.topbar-brand-text {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
}

.app-shell.nav-sidebar .topbar-brand-text {
  font-size: 1.5rem;
}

.sidebar-brand {
  display: none;
  padding: 0.3rem 0.55rem 0.25rem;
  border-bottom: 1px solid var(--border);
  line-height: 0;
}

.sidebar-logo {
  width: 100%;
  max-width: 168px;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

.app-nav-wrap { display: contents; }


.topbar-icon { font-size: 1.5rem; }

.topbar-title { font-size: 1.15rem; font-weight: 600; }

.topbar-actions { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }

.user-pill {

  font-size: 0.82rem; color: var(--text-secondary);

  padding: 0.35rem 0.75rem; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius);

}

.trial-pill {

  font-size: 0.78rem; padding: 0.3rem 0.65rem; border-radius: 999px;

  background: var(--warning-bg); color: var(--warning-text);

}

.trial-pill.expired { background: var(--danger-bg); color: var(--danger); }



.app-tabs { display: flex; background: var(--tab-bar); overflow-x: auto; border-bottom: 1px solid var(--border); }

.app-tab {

  display: inline-flex;
  align-items: center;
  gap: 0.4rem;

  background: transparent; border: none; color: var(--text-secondary);

  padding: 0.85rem 1.25rem; font-family: inherit; font-size: 0.92rem;

  cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent;

  transition: color 0.12s, background 0.12s;

}

.app-tab:hover { color: var(--text); background: var(--bg-control-hover); }

.app-tab.active {

  color: var(--accent); font-weight: 600; background: var(--bg-card);

  border-bottom-color: var(--accent);

}

.app-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}

.app-tab-badge.hidden { display: none !important; }

.app-shell.nav-sidebar .app-tab .app-tab-badge { margin-left: auto; }

/* Nav-undergrupper */
.nav-group { width: 100%; }
.nav-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 1rem 0.35rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
}
.nav-group-label::after {
  content: '▾';
  font-size: 0.65rem;
  opacity: 0.55;
  transition: transform 0.15s;
}
.nav-group:not(.open) .nav-group-label::after { transform: rotate(-90deg); }
.nav-group-items { display: none; flex-direction: column; }
.nav-group.open .nav-group-items { display: flex; }
.nav-group-items .app-tab {
  padding-left: 1.35rem !important;
  font-size: 0.84rem !important;
}

.app-shell:not(.nav-sidebar) .nav-group {
  display: contents;
}
.app-shell:not(.nav-sidebar) .nav-group-label { display: none; }
.app-shell:not(.nav-sidebar) .nav-group-items {
  display: contents;
}

/* Inventar-tabell */
.inv-table-wrap { overflow-x: auto; }
.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.inv-table th,
.inv-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.inv-table th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-subtle);
}
.inv-table tbody tr {
  cursor: pointer;
}
.inv-table tbody tr:hover { background: var(--bg-subtle); }
.inv-table .inv-title { font-weight: 600; color: var(--text); }
.inv-table .inv-muted { color: var(--text-muted); font-size: 0.78rem; }
.item-row-manufacturer {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Produsent accordion – kompakt liste */
.mfr-accordion { display: flex; flex-direction: column; gap: 0.2rem; }
.mfr-accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
}
.mfr-accordion-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.28rem 0.45rem;
  cursor: pointer;
  min-height: 2.15rem;
}
.mfr-accordion-head:hover { background: var(--bg-subtle); }
.mfr-accordion-media {
  width: 1.85rem;
  height: 1.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--bg-subtle);
  overflow: hidden;
  flex-shrink: 0;
}
.mfr-accordion-media img { width: 100%; height: 100%; object-fit: contain; padding: 0.1rem; }
.mfr-accordion-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  overflow: hidden;
}
.mfr-accordion-summary h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mfr-accordion-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.mfr-accordion-meta .manufacturer-location-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mfr-meta-sep {
  opacity: 0.55;
  flex-shrink: 0;
}
.mfr-email-link {
  color: var(--accent);
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mfr-email-link:hover { text-decoration: underline; }
.mfr-email-text { font-size: inherit; }
.mfr-accordion-links {
  display: flex;
  gap: 0.25rem;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.mfr-accordion-chevron {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.1rem 0.15rem;
  font-size: 0.75rem;
  line-height: 1;
}
.mfr-accordion-body {
  display: none;
  padding: 0.85rem 0.95rem 0.95rem;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}
.mfr-accordion-item.open .mfr-accordion-body { display: block; }
.mfr-accordion-item.open .mfr-accordion-chevron { transform: rotate(180deg); }
.mfr-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1rem;
}
.mfr-detail-block h4 {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.mfr-detail-row {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  line-height: 1.35;
}
.mfr-detail-row strong {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.05rem;
}
.mfr-accordion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}
.mfr-accordion-item.is-editing .mfr-view-only { display: none; }
.mfr-accordion-item:not(.is-editing) .mfr-edit-only { display: none; }

.decoder-brand-notes {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.decoder-model-table-wrap {
  overflow-x: auto;
  margin-top: 0.35rem;
}

.decoder-model-table {
  font-size: 0.78rem;
}

.shipment-share-panel {
  margin-top: 0.45rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}

.shipment-share-toggle {
  margin: 0;
}

.shipment-share-body {
  margin-top: 0.45rem;
}

.shipment-link-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 8.5rem;
  overflow-y: auto;
  margin: 0.4rem 0;
}

.shipment-link-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.82rem;
}

.shipment-link-item .muted {
  margin-left: auto;
  font-size: 0.74rem;
}

.shipment-split-hint {
  margin: 0.25rem 0 0;
  font-size: 0.76rem;
}

.shipment-share-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.shipment-share-summary:hover {
  border-color: var(--accent);
  background: rgba(196, 92, 38, 0.06);
}

.shipment-share-edit-hint {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.shipment-share-compact {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
}

.shipment-share-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.shipment-leave-toggle {
  margin: 0;
  font-size: 0.78rem;
}

.tag-shipment {
  background: rgba(196, 92, 38, 0.12);
  color: var(--accent);
  border: 1px solid rgba(196, 92, 38, 0.25);
}

.decoder-model-table th,
.decoder-model-table td {
  padding: 0.3rem 0.45rem;
}

.decoder-model-actions {
  white-space: nowrap;
  text-align: right;
}

.decoder-model-notes-cell {
  max-width: 14rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

.decoder-model-add-btn {
  margin-top: 0.45rem;
}

.mfr-inline-form { display: block; }
.mfr-inline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
}
.mfr-block-title {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.mfr-contact-edit-block,
.mfr-detail-edit-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}
.mfr-inline-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.mfr-inline-label.full { width: 100%; }
.mfr-tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.mfr-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.mfr-tag-chip:has(input:checked) {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}
.mfr-tag-chip input {
  width: 0.75rem;
  height: 0.75rem;
  margin: 0;
  flex-shrink: 0;
  min-height: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 2px !important;
}

.form-modal label.mfr-tag-chip {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  margin-bottom: 0 !important;
  gap: 0.2rem !important;
  font-size: 0.68rem !important;
  font-weight: 600 !important;
}
.mfr-tags-view {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.1rem;
}
.mfr-tag {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.25;
}
.mfr-tags-empty {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.mfr-product-picker { display: flex; flex-direction: column; gap: 0.4rem; width: 100%; }
.mfr-picker-hint { margin: 0 0 0.15rem; font-size: 0.72rem; }
.mfr-category-pick { margin: 0.15rem 0; }
.mfr-category-pick summary {
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.2rem 0;
}
.mfr-category-grid { margin-top: 0.35rem; }
.mfr-custom-product-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.15rem;
}
.mfr-custom-product-row .mfr-custom-product-input {
  flex: 1;
  min-width: 0;
  min-height: 28px;
  font-size: 0.78rem;
}
.mfr-tag-custom { padding-right: 0.25rem; }
.mfr-tag-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 0.15rem;
  margin-left: 0.1rem;
}
.mfr-tag-remove:hover { color: var(--danger, #c62828); }
.mfr-scales-section { margin-top: 0.25rem; }
.mfr-scales-hint { margin: 0.2rem 0 0; font-size: 0.72rem; }

@media (max-width: 720px) {
  .mfr-detail-grid,
  .mfr-inline-grid { grid-template-columns: 1fr; }
}



.app-main { flex: 1; padding: 1.5rem; max-width: 1100px; width: 100%; margin: 0 auto; }



.btn {

  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;

  padding: 0.55rem 1.1rem; min-height: 40px; border-radius: var(--radius);

  border: 1px solid transparent; font-family: inherit; font-size: 0.92rem;

  font-weight: 600; cursor: pointer;

}

.btn-orange { background: var(--orange); color: #fff; }

.btn-orange:hover { background: var(--orange-hover); }

.btn-green { background: var(--green); color: #fff; }

.btn-green:hover { background: var(--green-hover); }

.btn-primary { background: var(--navy); color: #fff; }

.btn-ghost { background: #fff; color: var(--text); border-color: var(--border-strong); }

.btn-ghost:hover { background: var(--bg-subtle); }

.btn-secondary { background: var(--bg-subtle); color: var(--text); border: 1px solid var(--border-strong); }

.btn-danger { background: var(--danger); color: #fff; }

.btn-danger:hover { background: var(--danger-hover); }

.btn-navy { background: var(--navy); color: #fff; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; min-height: 34px; }

.btn-block { width: 100%; }

.btn-icon { background: transparent; border: none; color: var(--text-secondary); font-size: 1.25rem; cursor: pointer; border-radius: var(--radius); }

.btn-topbar-ghost {

  background: var(--bg-control); border: 1px solid var(--border-strong); color: var(--text);

  width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: var(--radius);

}



.header-actions, .form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.form-actions { justify-content: flex-end; }



.card {

  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);

  padding: 1.35rem; margin-bottom: 1rem;

}

.card h2, .card-title { margin: 0 0 1rem; font-size: 1rem; font-weight: 700; }

.page-toolbar { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.page-toolbar-end { justify-content: flex-end; }

.search-input {

  flex: 1; min-width: 200px; padding: 0.65rem 1rem; font-size: 0.95rem;

  border: 1px solid var(--border-strong); border-radius: var(--radius); font-family: inherit;

}

.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0, 95, 184, 0.2); }

.muted { color: var(--text-muted); }



.budget-card { margin-bottom: 1rem; }

.budget-card h2 { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.75rem; }

.budget-note { margin: -0.35rem 0 0.65rem; font-size: 0.78rem; color: var(--text-muted); }

.progress-track { height: 14px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-bottom: 0.65rem; }

.progress-fill { height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 999px; }

.progress-track.over-budget .progress-fill { background: linear-gradient(90deg, #f87171, var(--danger)); }

.text-danger { color: var(--danger); }

.budget-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; font-size: 0.88rem; color: var(--text-secondary); }

/* Dashboard – The Rail Yard layout */
.dash-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.dash-page-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
}

.dash-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.dash-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.05rem;
  min-width: 0;
}

.dash-kpi-label {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.dash-kpi-value {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
}

.dash-kpi-value.dash-kpi-value-em {
  font-size: 1.95rem;
}

.dash-kpi-meta {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.dash-kpi-flow {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  margin-top: 0.45rem;
}

.dash-kpi-flow-line {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.dash-kpi-flow-result.dash-kpi-profit-pos { color: #15803d; font-weight: 600; }
.dash-kpi-flow-result.dash-kpi-profit-neg { color: var(--danger); font-weight: 600; }

.dash-budget-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.dash-status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.dash-status-ok { background: #dcfce7; color: #166534; }
.dash-status-over { background: var(--danger-bg); color: var(--danger); }

.dash-budget-spent .dash-budget-pct {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
}

.dash-progress { margin: 0.55rem 0 0.5rem; }

.dash-budget-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.dash-budget-note,
.dash-budget-hint {
  margin: 0.45rem 0 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.dash-section { margin-bottom: 1.15rem; }

.dash-section-title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.dash-inv-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.dash-inv-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 0.9rem;
  min-width: 0;
}

.dash-inv-icon { font-size: 1.35rem; line-height: 1; flex-shrink: 0; }

.dash-inv-body { min-width: 0; }

.dash-inv-body h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.dash-inv-count {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.dash-inv-meta {
  margin: 0.1rem 0 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.dash-insurance-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.dash-insurance-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.95rem 1rem;
}

.dash-insurance-card h3 {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.dash-ins-value {
  margin: 0.15rem 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.dash-ins-icon { font-size: 1.35rem; line-height: 1; flex-shrink: 0; }
.dash-ins-icon.ok { filter: none; }
.dash-ins-icon.warn { opacity: 0.9; }
.dash-ins-icon.info { opacity: 0.85; }

.dash-ins-hint { margin: 0; font-size: 0.74rem; }

.dash-ins-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.45rem;
}

.dash-ins-footer-text {
  flex: 1;
  min-width: 0;
}

.dash-ins-meta,
.dash-ins-hint,
.dash-ins-warn {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
}

.dash-ins-footer-text .dash-ins-meta + .dash-ins-hint,
.dash-ins-footer-text .dash-ins-warn + .dash-ins-hint {
  margin-top: 0.15rem;
}

.dash-ins-open-btn {
  flex-shrink: 0;
  font-weight: 600;
  white-space: nowrap;
}

/* Forsikring & verdivurdering */
.insurance-kpi-card { margin-bottom: 0.75rem; }

.insurance-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.insurance-kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.insurance-kpi-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.insurance-kpi-value {
  font-size: 1.15rem;
  color: var(--text);
}

.insurance-alert {
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid #e8b4b4;
  background: #fff4f4;
  color: #8a2a2a;
  font-size: 0.82rem;
}

.insurance-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.insurance-section-head .card-title { margin: 0; }

.insurance-doc-list {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.1rem;
  font-size: 0.8rem;
}

.insurance-checklist {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  line-height: 1.45;
}

.insurance-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.35rem;
}

.insurance-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.insurance-table col.ins-col-label { width: 42%; }
.insurance-table col.ins-col-desc { width: auto; }
.insurance-table col.ins-col-qty { width: 4.5rem; }
.insurance-table col.ins-col-money { width: 8.75rem; }
.insurance-table col.ins-col-actions { width: 9.5rem; }
.insurance-table col.ins-col-doc { width: 9.5rem; }
.insurance-table col.ins-col-missing { width: auto; }

.ins-doc-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}

.ins-doc-good {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.ins-doc-partial {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.ins-doc-weak {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.tag-doc-good { background: #dcfce7; color: #166534; }
.tag-doc-partial { background: #fef9c3; color: #854d0e; }
.tag-doc-weak { background: #fee2e2; color: #991b1b; }

.ins-doc-row { cursor: pointer; }
.ins-doc-row:hover { background: rgba(196, 92, 38, 0.05); }
.ins-doc-row-weak td { background: rgba(254, 226, 226, 0.25); }
.ins-doc-row-partial td { background: rgba(254, 249, 195, 0.2); }

.insurance-table .ins-col-doc,
.insurance-table th.ins-col-doc {
  text-align: center;
}

.insurance-table .ins-col-missing,
.insurance-table th.ins-col-missing {
  text-align: left;
  font-size: 0.76rem;
}

.insurance-table th,
.insurance-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.insurance-table thead th {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg-subtle);
}

.insurance-table tbody tr:last-child td { border-bottom: none; }

.insurance-table tfoot th {
  font-weight: 800;
  background: rgba(196, 92, 38, 0.06);
  border-top: 2px solid var(--border);
  border-bottom: none;
}

.insurance-table .ins-col-label {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insurance-table .ins-col-desc {
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insurance-table .ins-col-qty,
.insurance-table th.ins-col-qty {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.insurance-table .ins-col-money,
.insurance-table th.ins-col-money {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.insurance-table .ins-col-insured strong {
  color: var(--text);
}

.insurance-table .ins-col-actions {
  text-align: right;
  white-space: nowrap;
  padding-right: 0.35rem;
}

.insurance-table .ins-empty-row {
  text-align: center;
  padding: 1rem 0.75rem;
}

.insurance-assets-table .ins-col-actions .btn + .btn {
  margin-left: 0.15rem;
}

.insurance-policy-card { margin-bottom: 0.75rem; }
.insurance-policy-empty { border: 1px dashed var(--border); }
.insurance-policy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
}
.insurance-policy-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.82rem;
}
.insurance-policy-grid strong { font-size: 0.92rem; color: var(--text); }

.editable-image-gallery {
  margin-top: 0.5rem;
}

.img-gallery-figure {
  position: relative;
}

.img-gallery-figure.is-primary {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.img-primary-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.img-gallery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.btn-xs {
  font-size: 0.68rem;
  padding: 0.15rem 0.35rem;
  min-height: 0;
}

.callout-info {
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid #c8ddf5;
  background: #f3f8ff;
  font-size: 0.78rem;
  line-height: 1.45;
}

.callout-info p { margin: 0; }
.callout-info p + p { margin-top: 0.35rem; }

.valuation-panel { margin-top: 0.25rem; }

.valuation-suggest-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.65rem 0 0.75rem;
}

.valuation-suggest-box {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.valuation-suggest-box strong {
  font-size: 0.95rem;
  color: var(--text);
}

.valuation-suggest-box.highlight {
  border-color: var(--accent);
  background: rgba(196, 92, 38, 0.06);
}

.dash-recent-card { margin-top: 0.25rem; }

/* Skalakonverterer */
.scale-converter-page { display: flex; flex-direction: column; gap: 1rem; }

.scale-converter-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.scale-tool-card {
  padding: 0.85rem 0.95rem;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.scale-tool-title {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.scale-tool-desc {
  margin: 0 0 0.55rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.scale-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.scale-tool-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: 0;
}

.scale-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
  min-width: 0;
}

.scale-field-num {
  flex: 0 0 4.25rem;
}

.scale-field-unit {
  flex: 0 0 6.75rem;
}

.scale-card-body-real .scale-field-scale {
  flex: 0 0 7.25rem;
}

.scale-card-body-model .scale-field-scale {
  flex: 1 1 5.5rem;
  min-width: 4.75rem;
  max-width: 8.25rem;
}

.scale-field-num .win-input {
  width: 100%;
  text-align: right;
  padding-left: 0.45rem;
  padding-right: 0.45rem;
}

.scale-field .win-input {
  width: 100%;
  min-width: 0;
}

.scale-unit-hint {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  min-height: 0.85rem;
  line-height: 1.2;
  margin: 0;
  padding-left: 0.05rem;
}

.scale-result-inline {
  flex: 1 1 0;
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.scale-result-panel {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.55rem;
  width: 100%;
  min-width: 0;
}

.scale-result-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem 0.55rem;
  width: 100%;
  min-width: 0;
}

.scale-result-col h4 {
  margin: 0 0 0.2rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.scale-result-col p {
  margin: 0.06rem 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.scale-swap-btn {
  flex: 0 0 2rem;
  min-width: 2rem;
  min-height: 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  margin: 0;
  align-self: flex-end;
}

.scale-model-results-inline {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: 0.55rem 0.85rem;
  padding: 0.35rem 0.55rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 0;
}

.scale-model-result-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.1rem;
}

.scale-model-result strong {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

.scale-model-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
  margin: 0;
  min-width: 0;
}

@media (max-width: 900px) {
  .scale-converter-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .scale-tool-row {
    flex-wrap: wrap;
  }

  .scale-card-body-real .scale-field-scale,
  .scale-card-body-model .scale-field-scale {
    flex: 1 1 calc(50% - 0.25rem);
    max-width: none;
  }

  .scale-result-inline,
  .scale-model-results-inline {
    flex: 1 1 100%;
  }
}

@media (max-width: 980px) {
  .dash-kpi-row { grid-template-columns: 1fr; }
  .dash-inv-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-insurance-row { grid-template-columns: 1fr; }
  .insurance-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .valuation-suggest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .dash-inv-row { grid-template-columns: 1fr; }
}



.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1rem; }

.stat-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.15rem; text-align: center; }

.stat-box .stat-label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 0.35rem; }

.stat-box .stat-value { font-size: 1.65rem; font-weight: 800; color: var(--accent); }



.tag { display: inline-block; font-size: 0.72rem; font-weight: 600; padding: 0.18rem 0.55rem; border-radius: 999px; margin-right: 0.25rem; }

.tag-scale { background: var(--tag-gray-bg); color: var(--tag-gray-text); }

.tag-status { background: var(--tag-blue-bg); color: var(--tag-blue-text); }

.tag-type { background: var(--tag-blue-bg); color: var(--tag-blue-text); text-transform: uppercase; }



.item-list { display: flex; flex-direction: column; gap: 0.65rem; }

.item-row {

  display: flex; align-items: center; gap: 1rem; padding: 0.85rem 1rem;
  min-height: 5.5rem;

  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer;

}

.item-row:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }

.item-row-thumb {

  width: 72px; height: 72px; flex-shrink: 0; border-radius: var(--radius);

  overflow: hidden; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: 1.75rem;

}

.item-row-thumb img { width: 100%; height: 100%; }

.item-row-thumb img.thumb-photo {
  object-fit: contain;
  object-position: center;
}

.item-row-thumb img.thumb-logo {
  object-fit: contain;
  object-position: center;
  padding: 4px;
  background: #fff;
}

.item-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; min-height: 3.75rem; }

.item-row-body h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  line-height: 1.35;
  min-height: 2.7em;
}

.item-row-title-main { font-weight: 700; }

.item-row-title-sep {
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.65;
}

.item-row-title-meta {
  font-weight: 500;
  font-size: 0.88em;
  color: var(--text-secondary);
}

.item-row-title-mfr {
  color: var(--text-muted);
  font-weight: 500;
}

.item-row-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.25rem;
  min-height: 1.35rem;
  align-items: center;
  overflow: hidden;
}

.item-row-price { text-align: right; flex-shrink: 0; }

.item-row-price strong { display: block; font-size: 1.1rem; color: var(--price-orange); font-weight: 800; }

.item-row-price small { color: var(--text-muted); font-size: 0.82rem; }

.item-row-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }



.dealer-list { display: flex; flex-direction: column; }

.dealer-groups {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dealer-group-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.35rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.dealer-group-icon {
  font-size: 1rem;
  line-height: 1;
}

.dealer-group-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.08rem 0.45rem;
  margin-left: 0.15rem;
}

.dealer-group .dealer-row:first-child {
  padding-top: 0.35rem;
}

.dealer-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 0.25rem; border-bottom: 1px solid var(--border); }

.dealer-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; flex-shrink: 0; }

.page-hint { margin: -0.25rem 0 1rem; font-size: 0.92rem; }

.price-catalog-toolbar {
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin-bottom: 0.55rem;
}

.price-catalog-title {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 10rem;
}

.price-catalog-toolbar .search-input {
  flex: 1 1 200px;
  min-width: 180px;
  max-width: 320px;
}

.price-catalog-store-field {
  flex: 0 0 auto;
  min-width: 180px;
  margin: 0;
}

.price-catalog-hint {
  margin: 0 0 0.55rem;
}

.price-catalog-section { padding: 0 !important; overflow: visible !important; margin-bottom: 1rem; }

.price-catalog-panel { position: relative; }

.price-catalog-more { padding: 0.5rem 0.75rem; margin: 0; font-size: 0.78rem; }

/* Felles kolonne-grid – én rad, samme bredde i header og rader */
.price-offer-grid {
  display: grid;
  grid-template-columns: minmax(3.5rem, 1fr) minmax(4.5rem, 0.85fr) minmax(5rem, 0.95fr) minmax(4.2rem, 0.9fr) minmax(4.5rem, 1fr) minmax(3rem, 0.65fr) minmax(8.5rem, 1.1fr);
  column-gap: 0.45rem;
  align-items: center;
  padding: 0.22rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.2;
  min-height: 1.65rem;
  min-width: 42rem;
}

.price-offer-grid > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-col-unit,
.price-col-landing,
.price-col-diff {
  text-align: right;
  justify-self: stretch;
  font-variant-numeric: tabular-nums;
}

.price-offer-grid-head .price-col-unit,
.price-offer-grid-head .price-col-landing,
.price-offer-grid-head .price-col-diff {
  text-align: right;
}

.price-offer-grid-head,
.price-catalog-sticky-head {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.32rem 0.65rem;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface, #fff);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.price-col-actions,
.price-col-actions-head {
  text-align: right;
  white-space: nowrap !important;
  overflow: visible !important;
}

.price-col-landing { white-space: nowrap !important; text-align: right; }

.price-col-landing strong { font-weight: 600; }

.price-col-unit .btn-link.catalog-price-edit { display: inline-block; width: 100%; text-align: right; }

.price-catalog-list { display: flex; flex-direction: column; gap: 0.35rem; padding: 0.35rem 0 0.5rem; }

.price-catalog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.price-catalog-head {
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2, rgba(0, 0, 0, 0.02));
}

.price-catalog-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.price-catalog-head-main { flex: 1 1 12rem; min-width: 0; }

.price-catalog-head h3 { margin: 0; font-size: 0.9rem; line-height: 1.25; }

.price-catalog-meta { margin: 0.06rem 0 0; font-size: 0.74rem; line-height: 1.15; }

.price-catalog-offers { display: flex; flex-direction: column; }

.price-offer-row { border-bottom: 1px solid var(--border); }
.price-offer-row:last-child { border-bottom: none; }
.price-offer-row:hover { background: var(--surface-2, rgba(0, 0, 0, 0.02)); }

.price-catalog-head .catalog-group-dealer-pick.compact {
  flex: 0 0 auto;
  font-size: 0.72rem;
  margin: 0;
}

.price-catalog-head .catalog-group-dealer-pick.compact select {
  min-height: 24px;
  padding: 0.15rem 0.35rem;
  font-size: 0.72rem;
}

.price-product-pn { font-family: var(--font-mono, monospace); font-weight: 600; }

.price-compare-table { font-size: 0.78rem; table-layout: fixed; width: 100%; border-collapse: collapse; }

.price-compare-table th,
.price-compare-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  padding: 0.28rem 0.4rem;
  line-height: 1.2;
}

.price-compare-table thead th {
  padding: 0.35rem 0.4rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.price-compare-table tbody tr { border-bottom: 1px solid var(--border); }
.price-compare-table tbody tr:last-child { border-bottom: none; }

.price-compare-table .price-product-cell { white-space: normal; }
.price-compare-table .price-store-cell { width: 11%; }
.price-compare-table .price-unit-cell { width: 9%; }
.price-compare-table .price-landing-cell { width: 12%; white-space: normal; }
.price-compare-table .price-vat-cell { width: 10%; font-size: 0.72rem; }
.price-compare-table .price-date-cell { width: 10%; font-size: 0.72rem; }
.price-compare-table .price-diff-cell { width: 8%; }
.price-compare-table .price-actions-cell { width: 11%; text-align: right; padding-right: 0.5rem; white-space: nowrap; }

.price-compare-table .table-wrap { margin: 0; }

.price-extras-inline {
  display: inline;
  margin-left: 0.25rem;
  font-size: 0.65rem;
  line-height: 1.1;
}

.price-pack-hint { display: block; font-size: 0.65rem; line-height: 1.1; }

.tag.tag-sm { font-size: 0.62rem; padding: 0.04rem 0.28rem; line-height: 1.2; }

.catalog-pack-summary {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  line-height: 1.45;
}

.catalog-pack-chip {
  display: inline-block;
  margin: 0.15rem 0.5rem 0.15rem 0;
  padding: 0.15rem 0.45rem;
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.catalog-pack-chip:hover {
  background: var(--surface-3, rgba(0, 0, 0, 0.07));
  border-color: var(--text-muted);
}

.catalog-pack-field { min-width: 7rem !important; max-width: 8rem; }

.price-row-best { background: rgba(46, 125, 50, 0.06); }
.price-row-unavailable { opacity: 0.78; }
.price-row-unavailable .price-col-unit .btn-link { text-decoration: line-through; }
.price-col-actions .catalog-action-link,
.price-col-actions .price-action-sep { display: inline; vertical-align: baseline; }
.price-action-sep { color: var(--text-muted); opacity: 0.45; margin: 0 0.12rem; font-size: 0.68rem; user-select: none; }
.catalog-action-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.catalog-action-link:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: 2px; }
.catalog-action-danger { color: var(--danger, #c62828); }
.catalog-action-danger:hover { color: #a31515; }
.catalog-price-modal-actions {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1rem; padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.catalog-status-hint { margin-top: 0.35rem; }
.catalog-dealer-unavailable { opacity: 0.65; }
.catalog-dealer-unavailable input:disabled { cursor: not-allowed; }

.price-vat-note { font-size: 0.82rem; line-height: 1.3; max-width: 10rem; display: inline-block; }

.price-diff { color: var(--danger, #c62828); font-size: 0.76rem; }

.exchange-rates-row { flex-wrap: wrap; gap: 0.75rem; }

.exchange-rates-row .win-field { min-width: 140px; }

.exchange-rate-row { display: flex; align-items: flex-end; gap: 0.5rem; flex-wrap: wrap; }

.exchange-rate-row .inline-field { flex: 1; min-width: 180px; margin: 0; }

.catalog-dealer-pick-actions { display: flex; gap: 0.35rem; margin-bottom: 0.5rem; }

.store-multi-field { margin: 0; }

.store-multi-wrap { display: block; width: 100%; }

.store-multi-dropdown { position: relative; }

.store-multi-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  min-height: 2.25rem;
  padding: 0.35rem 0.65rem;
  user-select: none;
}

.store-multi-trigger::-webkit-details-marker { display: none; }

.store-multi-summary {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
}

.store-multi-caret { opacity: 0.45; font-size: 0.75rem; }

.store-multi-panel {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  margin-top: 0.2rem;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.store-multi-toolbar {
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem 0.45rem;
  border-bottom: 1px solid var(--border);
}

.store-multi-list {
  max-height: 9rem;
  overflow-y: auto;
  padding: 0.15rem 0;
}

.store-multi-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.6rem;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.25;
}

.store-multi-row.has-price {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.65rem;
  align-items: start;
}

.store-multi-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  cursor: pointer;
  margin: 0;
}

.store-pick-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.08rem;
}

.store-pick-home-hint {
  font-size: 0.68rem;
  line-height: 1.2;
  white-space: nowrap;
}

.store-pick-price-fields {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.store-pick-price { width: 4.5rem; min-height: 1.75rem; padding: 0.2rem 0.35rem; font-size: 0.82rem; }

.store-pick-currency { width: 3.5rem; min-height: 1.75rem; padding: 0.2rem 0.25rem; font-size: 0.78rem; }

.store-multi-field-wide .store-multi-panel { min-width: 18rem; }

.store-multi-list { max-height: 14rem; }

.btn-link.catalog-price-edit {
  background: none;
  border: none;
  padding: 0;
  color: var(--link, var(--price-orange));
  cursor: pointer;
  font: inherit;
  font-size: inherit;
  line-height: 1.2;
  text-decoration: underline dotted;
}

.btn-link.catalog-price-edit:hover { opacity: 0.85; }

.price-unit-cell { white-space: nowrap; }

.store-multi-row:hover { background: var(--surface-2, rgba(0, 0, 0, 0.03)); }

.store-multi-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-multi-meta { font-size: 0.78rem; white-space: nowrap; }

.store-multi-hint { margin: 0.2rem 0 0; font-size: 0.78rem; line-height: 1.3; }

.anyrail-store-pick { margin-top: 0.75rem; }

.catalog-dealer-pick-list { display: flex; flex-direction: column; gap: 0.35rem; }

.catalog-dealer-option {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.5rem 0.75rem;
  align-items: center;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.catalog-dealer-option:hover { background: var(--surface-2, rgba(0,0,0,0.03)); }

.catalog-dealer-name { font-weight: 600; }

.catalog-dealer-price { font-size: 0.9rem; }

.price-catalog-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }

.catalog-group-dealer-pick { font-size: 0.85rem; min-width: 220px; }

.catalog-filter-note { margin: 0 0 0.75rem; font-size: 0.92rem; }

.dealer-row:last-child { border-bottom: none; }

.dealer-icon { font-size: 1.5rem; width: 40px; height: 40px; text-align: center; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.dealer-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius);
  background: #fff;
  padding: 2px;
}

.logo-upload-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.store-logo-preview {
  width: 72px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  overflow: hidden;
}

.store-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.logo-upload-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.decoder-logo-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.decoder-logo-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 52px auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.decoder-logo-row:last-child { border-bottom: none; }

.decoder-logo-name { font-weight: 600; font-size: 0.88rem; }

.decoder-logo-preview {
  width: 52px;
  height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  overflow: hidden;
}

.decoder-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
  background: #fff;
}

@media (max-width: 720px) {
  .decoder-logo-row {
    grid-template-columns: 1fr 52px;
    grid-template-rows: auto auto;
  }
  .decoder-logo-row .btn,
  .decoder-logo-row .decoder-logo-url,
  .decoder-logo-row span:empty { grid-column: 1 / -1; }
}

.dealer-info { flex: 1; }

.dealer-info h3 { margin: 0; font-size: 1rem; font-weight: 700; }

.dealer-info p { margin: 0.15rem 0 0; font-size: 0.85rem; color: var(--text-muted); }

.dealer-edit { color: var(--accent); font-size: 0.88rem; font-weight: 600; background: none; border: none; cursor: pointer; font-family: inherit; }



.filter-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 1rem; }

.filter-tab {

  padding: 0.4rem 0.85rem; border: 1px solid var(--border); border-radius: 999px;

  background: #fff; font-size: 0.82rem; cursor: pointer; color: var(--text-secondary); font-family: inherit;

}

.filter-tab.active { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent); font-weight: 600; }



.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; }

.modal.hidden { display: none !important; }

.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); z-index: 0; }

.modal-v2 {

  position: relative; z-index: 2; isolation: isolate; background: #fff; border-radius: var(--radius-lg);

  width: 100%; max-width: 780px; max-height: 92vh; overflow: hidden;

  display: flex; flex-direction: column; box-shadow: var(--shadow);

}

.modal-v2.modal-wide { max-width: 860px; }

.modal-v2-header {

  background: var(--bg-subtle); color: var(--text); padding: 0.9rem 1.25rem;

  display: flex; justify-content: space-between; align-items: center;

  border-bottom: 1px solid var(--border);

}

.modal-v2-header h2 { margin: 0; font-size: 1.05rem; font-weight: 600; }

.modal-v2-body { overflow-y: auto; flex: 1; }



.object-summary {

  display: flex; gap: 1rem; padding: 1rem 1.25rem;

  border-bottom: 1px solid var(--border); background: var(--bg-subtle);

}

.object-summary-thumb {

  width: 80px; height: 80px; flex-shrink: 0; border-radius: var(--radius);

  overflow: hidden; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: 2rem;

}

.object-summary-thumb img { width: 100%; height: 100%; object-fit: cover; }

.object-summary-info h3 { margin: 0 0 0.35rem; font-size: 1.35rem; font-weight: 700; color: var(--text); }

.object-summary-meta { font-size: 0.88rem; color: var(--text-secondary); }

.object-summary-meta .price { color: var(--price-orange); font-weight: 700; }



.modal-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 2.875rem;
  padding: 0 1.25rem;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
  flex-shrink: 0;
  scrollbar-width: thin;
}

.modal-tab {

  background: none; border: none; padding: 0.8rem 1rem; font-family: inherit;

  font-size: 0.88rem; color: var(--text-muted); cursor: pointer;

  white-space: nowrap; flex-shrink: 0;
  line-height: 1.25;
  position: relative;
  z-index: 6; pointer-events: auto;

}

.modal-tab::after {
  content: '';
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: -2px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}

.modal-tab.active { color: var(--accent); font-weight: 600; }

.modal-tab.active::after { background: var(--accent); }

.modal-tab.hidden { display: none; }

.tab-panel { padding: 0.65rem 0.85rem; display: none; }

.tab-panel.active { display: block; }

.tab-panel.hidden-panel { display: none !important; }

/* Stabil høyde når man bytter fane – unngår «hopp» i modal */
.form-modal #item-form {
  min-height: 0;
}

.form-modal .tab-panel.active,
.modal-v2 .modal-v2-body > .tab-panel.active {
  min-height: 0;
}

.hidden-panel { display: none !important; }

#item-form { position: relative; z-index: 1; }



.modal-v2-footer {

  padding: 0.85rem 1.25rem; border-top: 1px solid var(--border);

  display: flex; justify-content: space-between; align-items: center; background: var(--bg-subtle);

}

.modal-v2-footer .footer-right { display: flex; gap: 0.5rem; }

.footer-remove-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.mount-status-locked {
  background: var(--bg-subtle) !important;
  color: var(--text-secondary);
  cursor: not-allowed;
}

.modal-v2 { position: relative; }

.sell-overlay-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35);
  z-index: 20; border-radius: inherit;
}

.sell-overlay-panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 21; width: min(560px, calc(100% - 2rem));
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 1rem 1.1rem;
}

.sell-overlay-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.5rem;
}

.sell-overlay-head h3 { margin: 0; font-size: 1.05rem; }

.sell-overlay-actions {
  display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.75rem;
}



.form-modal .modal-v2-body { padding: 0; }

.form-modal label:not(.mfr-tag-chip):not(.win-check) {

  display: flex; flex-direction: column; gap: 0.2rem; margin-bottom: 0.5rem;

  font-size: 0.78rem; color: var(--text-secondary); font-weight: 600;

}

.form-modal label.full { grid-column: 1 / -1; }

.form-modal label.hidden-panel { display: none; }

.form-modal input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.form-modal select,
.form-modal textarea {

  padding: 0.4rem 0.6rem; font-size: 0.85rem; border: 1px solid var(--border-strong);

  border-radius: var(--radius); font-family: inherit; min-height: 32px; font-weight: 400;

}

.form-modal textarea { min-height: 56px; resize: vertical; }

.form-modal input:focus, .form-modal select:focus, .form-modal textarea:focus {

  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0, 95, 184, 0.2);

}

.form-modal input[readonly] { background: var(--bg-subtle); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.65rem; }

.input-row { display: flex; gap: 0.5rem; align-items: stretch; }

.input-row select { flex: 1; }



.form-section-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.65rem 0.75rem; margin-top: 0.55rem; }

.form-section-box.orange-border { border-color: var(--orange); }

.image-upload-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.55rem 0.65rem; margin-top: 0.35rem; background: var(--bg-subtle); }

.receipt-zone {

  border: 2px dashed var(--border-strong); border-radius: var(--radius);

  padding: 1rem; text-align: center; background: var(--bg-subtle); cursor: pointer;

}



.thumb-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

.thumb-grid figure { margin: 0; width: 90px; height: 90px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); position: relative; }

.thumb-grid img { width: 100%; height: 100%; object-fit: cover; }

.thumb-main-badge { position: absolute; bottom: 4px; left: 4px; background: var(--accent); color: #fff; font-size: 0.65rem; font-weight: 700; padding: 0.1rem 0.35rem; border-radius: 3px; }



.service-toolbar { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 0.5rem; flex-wrap: wrap; gap: 0.35rem; }

.project-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.55rem 0.75rem; margin-bottom: 0.45rem; }

.project-card-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; }

.project-card-head .badge { font-size: 0.65rem; padding: 0.1rem 0.4rem; }

.decoder-pick { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }

.decoder-pick.compact { gap: 0.4rem; margin-top: 0.5rem; padding: 0.65rem 0.75rem; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius); }

.decoder-pick.compact .pick-label { margin: 0 0 0.15rem; font-size: 0.78rem; }

.decoder-pick.compact .pick-field { font-size: 0.78rem; margin: 0; }

.decoder-pick.compact .pick-field textarea { padding: 0.35rem 0.5rem; font-size: 0.82rem; min-height: 2.2rem; }

.decoder-option { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }

.decoder-option.compact { padding: 0.4rem 0.55rem; font-size: 0.82rem; gap: 0.45rem; }

.parts-pick.compact { margin-top: 0.15rem; }

.parts-pick-label { display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.25rem; }

.parts-pick-list { display: flex; flex-wrap: wrap; gap: 0.25rem 0.65rem; }

.parts-pick-item { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; color: var(--text-secondary); cursor: pointer; margin: 0; }

.service-parts-used { margin: 0.25rem 0 0; font-size: 0.78rem; color: var(--text-secondary); }

.service-parts-label { font-weight: 600; color: var(--text-muted); }

/* Info-knapp (?) ved felt */
.field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.field-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-control);
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
  vertical-align: middle;
}

.field-info-btn:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

/* Kompakt service / dekoder-montering */
.service-toolbar.compact {
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.service-toolbar.compact .service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.decoder-pick.mini {
  margin-top: 0.35rem;
  padding: 0.45rem 0.55rem;
  gap: 0.35rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mount-row {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.mount-field {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}

.mount-field input,
.mount-field select {
  padding: 0.3rem 0.45rem;
  font-size: 0.82rem;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mount-row > .btn { flex-shrink: 0; margin-bottom: 1px; }

.service-inline-form.mini {
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.parts-pick-details {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.parts-pick-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.15rem 0;
  list-style: none;
}

.parts-pick-details summary::-webkit-details-marker { display: none; }

.parts-pick-details[open] summary { margin-bottom: 0.25rem; }

.parts-pick-details .parts-pick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
}

/* Kompakt objekt-header i modal */
.object-summary.compact {
  padding: 0.45rem 0.85rem !important;
  gap: 0.55rem !important;
  align-items: center;
  min-height: 3.35rem;
}

.object-summary.compact .object-summary-thumb {
  width: 40px !important;
  height: 40px !important;
  font-size: 1.25rem !important;
}

.object-summary-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.object-summary-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.object-summary.compact .object-summary-meta {
  font-size: 0.75rem;
  margin-top: 0.1rem;
}



.spec-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }

.spec-table tr:nth-child(odd) { background: #f8fafc; }

.spec-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); }

.spec-table td:first-child { color: var(--text-secondary); font-weight: 600; width: 42%; }



.badge { display: inline-block; background: var(--tag-blue-bg); color: var(--tag-blue-text); font-size: 0.72rem; padding: 0.2rem 0.55rem; border-radius: 999px; font-weight: 600; }

.info-box { background: var(--accent-light); border: 1px solid #93c5fd; border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }



.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }

.lang-btn { padding: 0.85rem; border: 2px solid var(--border); border-radius: var(--radius); background: #fff; cursor: pointer; font-family: inherit; }

.lang-btn.selected { border-color: var(--accent); background: var(--accent-light); font-weight: 600; color: var(--accent); }

.country-checkboxes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; max-height: 200px; overflow-y: auto; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius); }

.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }

.onboarding-progress { display: flex; gap: 0.4rem; margin-bottom: 1rem; }

.onboarding-progress span { flex: 1; height: 4px; background: var(--border); border-radius: 2px; }

.onboarding-progress span.active { background: var(--accent); }

.onboarding-progress span.done { background: var(--success); }



#toast-container { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 3000; }

.toast { background: #fff; border: 1px solid var(--border); padding: 0.75rem 1.15rem; border-radius: var(--radius); box-shadow: var(--shadow); opacity: 0; transition: 0.25s; }

.toast.show { opacity: 1; }

.toast-success { border-color: #86efac; background: #f0fdf4; }

.toast-info { border-color: #93c5fd; background: #eff6ff; max-width: 22rem; }



@media (max-width: 768px) {

  .form-grid { grid-template-columns: 1fr; }

  .item-row { flex-wrap: wrap; }

  .budget-stats { grid-template-columns: 1fr; }

  .settings-form .settings-row { grid-template-columns: 1fr; }

}

/* ── Kompakt layout + Windows 11 skjemafelt ── */
.app-topbar { padding: 0.5rem 1.15rem !important; }
.topbar-title { font-size: 1rem !important; }
.topbar-icon { font-size: 1.25rem !important; }
.app-tab { padding: 0.65rem 1rem !important; font-size: 0.85rem !important; }
.app-main { padding: 1rem 1.15rem !important; max-width: 1000px !important; }

.btn { padding: 0.4rem 0.85rem !important; min-height: 32px !important; font-size: 0.85rem !important; }
.btn-sm { padding: 0.28rem 0.65rem !important; font-size: 0.78rem !important; min-height: 28px !important; }

.card { padding: 1rem 1.1rem !important; margin-bottom: 0.75rem !important; }
.card h2, .card-title { font-size: 0.92rem !important; margin-bottom: 0.75rem !important; }

.stat-box { padding: 0.85rem 1rem !important; }
.stat-box .stat-value { font-size: 1.35rem !important; }
.stat-box .stat-label { font-size: 0.65rem !important; }

.item-row { padding: 0.6rem 0.75rem !important; gap: 0.75rem !important; min-height: 5rem !important; }
.item-row-thumb { width: 56px !important; height: 56px !important; font-size: 1.35rem !important; }
.item-row-body { min-height: 3.25rem !important; }
.item-row-body h3 { font-size: 0.92rem !important; min-height: 2.5em !important; }
.item-row-price strong { font-size: 0.95rem !important; }

.modal-v2-header { padding: 0.65rem 1rem !important; }
.modal-v2-header h2 { font-size: 0.95rem !important; }
.modal-tab { padding: 0.55rem 0.7rem !important; font-size: 0.8rem !important; min-height: 2.25rem; }
.tab-panel { padding: 0.55rem 0.75rem !important; }
.form-modal #item-form { min-height: 0 !important; }
.form-modal .tab-panel.active,
.modal-v2 .modal-v2-body > .tab-panel.active { min-height: 0 !important; }
.modal-v2-footer { padding: 0.5rem 0.85rem !important; }
.object-summary { padding: 0.55rem 0.75rem !important; }
.object-summary-thumb { width: 56px !important; height: 56px !important; }
.object-summary-info h3 { font-size: 1rem !important; }

.form-modal label:not(.mfr-tag-chip):not(.win-check) { margin-bottom: 0.45rem !important; font-size: 0.76rem !important; gap: 0.2rem !important; }
.form-grid { gap: 0 0.55rem !important; }

.win-input,
.form-modal .win-input,
.settings-form .win-input {
  width: 100%;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  min-height: 32px;
  border: 1px solid #cbd5e1;
  border-bottom-color: #94a3b8;
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.win-input:hover { border-color: #94a3b8; }
.win-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
select.win-input {
  appearance: none;
  padding-right: 1.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  cursor: pointer;
}
textarea.win-input { min-height: 64px; resize: vertical; }

.win-check {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem; font-weight: 500; color: var(--text);
  margin: 0.35rem 0; cursor: pointer;
}
.win-check input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0; accent-color: var(--accent);
}

.settings-page { display: flex; flex-direction: column; gap: 0.75rem; max-width: 640px; }
.settings-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1rem 1.15rem; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.settings-heading { margin: 0 0 0.65rem; font-size: 0.95rem; font-weight: 700; }
.settings-desc { margin: 0 0 0.65rem; font-size: 0.82rem; color: var(--text-muted); line-height: 1.45; }
.settings-meta { margin: 0 0 0.65rem; font-size: 0.78rem; color: var(--text-secondary); }
.settings-form .settings-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.35rem;
}
.settings-fieldset {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.65rem 0.85rem; margin: 0.5rem 0; background: var(--bg-subtle);
}
.settings-fieldset legend {
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); padding: 0 0.25rem;
}

/* Toglengde 1:1 – dashboard + registrering */
.fleet-length-card { margin-bottom: 0.75rem !important; }

.fleet-length-desc {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.fleet-length-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.fleet-length-box {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.fleet-length-icon { font-size: 1.75rem; line-height: 1; flex-shrink: 0; }

.fleet-length-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }

.fleet-length-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.fleet-length-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.fleet-length-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.fleet-length-total {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.fleet-length-total strong { color: var(--text); }

.dim-row {
  display: grid;
  grid-template-columns: repeat(3, 7rem);
  align-items: start;
  gap: 0 0.65rem;
  width: fit-content;
}

.dim-row.cols-2 { grid-template-columns: repeat(2, 7rem); }

.dim-field {
  display: grid;
  grid-template-rows: 1.1rem 28px;
  gap: 0.25rem;
  margin: 0 !important;
  min-width: 0;
}

.dim-label-row {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.1;
  white-space: nowrap;
  height: 1.1rem;
  overflow: visible;
}

.dim-field input[type=number],
.dim-value {
  width: 100%;
  height: 28px;
  min-height: 28px !important;
  max-height: 28px;
  padding: 0 0.45rem !important;
  font-size: 0.8rem !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-sizing: border-box;
  margin: 0;
}

.dim-value {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  color: var(--accent);
  font-weight: 600;
  line-height: 1;
}

.dim-readonly .field-info-btn { flex-shrink: 0; }

#item-dim-section .dim-field {
  font-size: inherit !important;
  gap: 0.25rem !important;
}

.item-row-stars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  line-height: 1;
}

.item-rating-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .fleet-length-grid { grid-template-columns: 1fr; }
}
.settings-countries {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 0.75rem;
  max-height: 160px; overflow-y: auto; padding: 0.25rem 0; border: none; margin: 0; background: transparent;
}
.settings-actions { margin-top: 0.75rem; }
.search-input { padding: 0.45rem 0.75rem !important; font-size: 0.85rem !important; }
.progress-track { height: 10px !important; }
.budget-stats { font-size: 0.8rem !important; }

/* Alle skjemafelt i modaler får Win11-stil */
.form-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-modal select,
.form-modal textarea,
.search-input {
  padding: 0.4rem 0.65rem !important;
  font-size: 0.85rem !important;
  min-height: 32px !important;
  border: 1px solid #cbd5e1 !important;
  border-bottom-color: #94a3b8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
.form-modal select {
  appearance: none !important;
  padding-right: 1.75rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.55rem center !important;
}
.form-modal input:focus, .form-modal select:focus, .form-modal textarea:focus {
  outline: none !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
}
.form-modal textarea { min-height: 48px !important; }

.win-field {
  display: flex; flex-direction: column; gap: 0.25rem;
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
}

/* Skjema i forhandler-modal – mer luft, kompakte avkrysningsbokser */
.form-modal .win-form {
  padding: 1rem 1.15rem 0.5rem;
  gap: 0 0.85rem;
}
.form-modal label.win-check {
  flex-direction: row !important;
  align-items: center !important;
  margin-bottom: 0 !important;
  gap: 0.4rem !important;
  font-weight: 500 !important;
  font-size: 0.82rem !important;
}
.form-modal label.win-check input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
  min-height: 0 !important;
  flex-shrink: 0;
}
.form-check-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin: 0.15rem 0 0;
  grid-column: 1 / -1;
}
.form-hint {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  grid-column: 1 / -1;
}
.form-modal .win-field { margin-bottom: 0; }

/* App-body + sidemeny */
.app-body { display: flex; flex: 1; flex-direction: column; min-height: 0; }

.app-shell.nav-sidebar .app-body { flex-direction: row; align-items: stretch; }

.app-shell.nav-sidebar .app-nav-wrap {
  display: flex;
  flex-direction: column;
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  background: var(--header-dark, var(--tab-bar));
  border-right: 1px solid var(--border);
}

.app-shell.nav-sidebar .topbar-brand { display: flex; }

.app-shell.nav-sidebar .app-tabs {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  flex-shrink: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-top: none;
  border-right: none;
  border-bottom: none;
  padding: 0.35rem 0 0.4rem;
  flex: 1;
  min-height: 0;
}

.app-shell.nav-sidebar .app-tab {
  width: 100%;
  text-align: left;
  padding: 0.65rem 1rem !important;
  border-top: none !important;
  border-left: 3px solid transparent;
  justify-content: flex-start;
}

.app-shell.nav-sidebar .app-tab.active {
  border-left-color: var(--accent) !important;
  border-top-color: transparent !important;
  background: var(--bg-nav-active) !important;
  color: var(--text) !important;
}

.app-shell.nav-sidebar .app-main {
  flex: 1;
  max-width: none !important;
  min-width: 0;
}

/* Backup-påminnelse i sidemeny */
.nav-backup-reminder {
  flex-shrink: 0;
  margin: 0.35rem 0.5rem 0.5rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 0.72rem;
  line-height: 1.35;
}
.nav-backup-reminder.never { border-color: #c5daf5; background: #eef5ff; }
.nav-backup-reminder.soon { border-color: #ecd9a8; background: #fff8e8; }
.nav-backup-reminder.urgent { border-color: #e8b4b4; background: #fff0f0; }
.nav-backup-reminder-icon { display: block; font-size: 1rem; margin-bottom: 0.2rem; }
.nav-backup-reminder-text { margin: 0 0 0.45rem; color: var(--text-secondary); }
.nav-backup-reminder-btn {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.nav-backup-reminder-btn:hover { border-color: var(--accent); color: var(--accent); }

.app-shell.nav-top .nav-backup-reminder {
  margin: 0.35rem 0 0;
  max-width: 100%;
}

.backup-info-callout {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid #c5daf5;
  background: linear-gradient(180deg, #f4f8ff 0%, #eef5ff 100%);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
.backup-info-callout p { margin: 0 0 0.5rem; }
.backup-info-list {
  margin: 0;
  padding-left: 1.15rem;
}
.backup-info-list li { margin-bottom: 0.25rem; }

.backup-status-card {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
}
.backup-status-card.backup-status-ok { border-color: #b8dfc4; background: #f0faf3; }
.backup-status-card.backup-status-soon { border-color: #ecd9a8; background: #fff8e8; }
.backup-status-card.backup-status-urgent { border-color: #e8b4b4; background: #fff0f0; }
.backup-status-card.backup-status-never { border-color: #c5daf5; background: #eef5ff; }
.backup-status-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.backup-status-title { display: block; font-size: 0.85rem; margin-bottom: 0.15rem; }
.backup-status-text { margin: 0; font-size: 0.78rem; color: var(--text-secondary); line-height: 1.45; }
.backup-actions { margin-bottom: 0.5rem; }
.backup-auto-section { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.backup-auto-file-row { margin-top: 0.5rem; }
.backup-auto-file-label { margin: 0 0 0.4rem; font-size: 0.78rem; color: var(--text-secondary); }

/* Service-fane */
.service-section-title {
  margin: 0.65rem 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.service-record-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
  margin-bottom: 0.35rem;
  background: #fff;
}

.service-record-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.service-record-cost {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.btn-link-danger {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.25rem;
  margin-left: 0.25rem;
}

.btn-link-danger:hover { color: var(--danger); }

.project-card.done { opacity: 0.72; }

.project-card-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.service-inline-form {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.75rem;
}

.service-inline-actions { display: flex; gap: 0.5rem; }

.decoder-option { cursor: pointer; }

@media (max-width: 768px) {
  .app-shell.nav-sidebar .app-body { flex-direction: column; }
  .app-shell.nav-sidebar .app-nav-wrap {
    width: 100%;
    min-width: 0;
  }
  .app-shell.nav-sidebar .sidebar-brand { display: none; }
  .app-shell.nav-sidebar .topbar-brand { display: flex; }
  .app-shell.nav-sidebar .app-tabs {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    overflow-x: auto;
  }
  .app-shell.nav-sidebar .app-tab {
    width: auto;
    border-left: none !important;
    border-top: 3px solid transparent !important;
  }
  .app-shell.nav-sidebar .app-tab.active {
    border-top-color: var(--accent) !important;
    border-left-color: transparent !important;
  }
}

/* ═══════════════════════════════════════════
   Windows 11 Fluent – menyer, knapper, flater
   ═══════════════════════════════════════════ */

.app-shell { background: var(--bg); }

/* Toppmeny / tittellinje */
.app-topbar {
  background: var(--header) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 1rem !important;
}

.topbar-title { font-size: 0.92rem !important; font-weight: 600; color: var(--text); }
.topbar-icon { font-size: 1.15rem !important; }

.user-pill {
  color: var(--text-secondary) !important;
  background: var(--bg-subtle) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.trial-pill {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.btn-topbar-ghost {
  background: var(--bg-control) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text) !important;
  border-radius: var(--radius) !important;
}

.btn-topbar-ghost:hover { background: var(--bg-control-hover) !important; }

/* Horisontal navigasjon (Win11 Settings-stil) */
.app-tabs {
  background: var(--tab-bar) !important;
  border-bottom: 1px solid var(--border);
  padding: 0 0.5rem !important;
  gap: 0.15rem;
}

.app-tab {
  color: var(--text-secondary) !important;
  padding: 0.55rem 0.85rem !important;
  font-size: 0.84rem !important;
  font-weight: 400;
  border-top: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0 !important;
}

.app-tab:hover {
  color: var(--text) !important;
  background: var(--bg-control-hover) !important;
}

.app-tab.active {
  color: var(--accent) !important;
  font-weight: 600 !important;
  background: var(--bg-card) !important;
  border-bottom-color: var(--accent) !important;
}

/* Sidemeny */
.app-shell.nav-sidebar .app-tabs {
  background: var(--header-dark) !important;
  border-right: 1px solid var(--border);
  border-bottom: none;
  padding: 0.2rem 0.5rem 0.35rem !important;
}

.app-shell.nav-sidebar .app-tab {
  border-radius: var(--radius) !important;
  border-bottom: none !important;
  border-left: 3px solid transparent !important;
  margin: 0.1rem 0;
  text-align: left;
}

.app-shell.nav-sidebar .app-tab:hover {
  background: var(--bg-control-hover) !important;
}

.app-shell.nav-sidebar .app-tab.active {
  background: var(--bg-nav-active) !important;
  border-left-color: var(--accent) !important;
  color: var(--text) !important;
}

.app-main { background: var(--bg); }

/* Knapper – Win11 standard / accent */
.btn {
  border-radius: var(--radius) !important;
  font-weight: 400 !important;
  transition: background 0.1s, border-color 0.1s, box-shadow 0.1s;
}

.btn-orange,
.btn-primary,
.btn-navy {
  background: var(--accent) !important;
  color: #fff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.btn-orange:hover,
.btn-primary:hover,
.btn-navy:hover {
  background: var(--accent-hover) !important;
}

.btn-green {
  background: var(--green) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.btn-green:hover { background: var(--green-hover) !important; }

.btn-ghost,
.btn-secondary {
  background: var(--bg-control) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-strong) !important;
}

.btn-secondary {
  background: var(--bg-subtle) !important;
}

.btn-ghost:hover,
.btn-secondary:hover {
  background: var(--bg-control-hover) !important;
}

.btn-danger {
  background: var(--danger) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Kort og lister */
.card,
.item-row,
.stat-box,
.settings-card,
.auth-card,
.onboarding-card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
}

.item-row:hover {
  background: var(--bg-card) !important;
  border-color: var(--border-strong) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

.stat-box .stat-value { color: var(--accent) !important; font-weight: 700 !important; }

/* Filterpiller */
.filter-tab {
  background: var(--bg-control) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius) !important;
}

.filter-tab:hover { background: var(--bg-control-hover) !important; color: var(--text) !important; }

.filter-tab.active {
  background: var(--accent-subtle) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* Søkefelt */
.search-input {
  background: var(--bg-control) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius) !important;
}

.search-input:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(0, 95, 184, 0.2) !important;
}

/* Modal – Win11 dialog */
.modal-backdrop { background: rgba(0, 0, 0, 0.3) !important; }

.modal-v2 {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.14) !important;
}

.modal-v2-header {
  background: var(--bg-subtle) !important;
  color: var(--text) !important;
  border-bottom: 1px solid var(--border) !important;
}

.modal-v2-header h2 { color: var(--text) !important; font-weight: 600 !important; }

.modal-v2-header .btn-icon,
.modal-v2-header .btn-icon:hover {
  color: var(--text-secondary) !important;
  border-radius: var(--radius);
}

.modal-v2-header .btn-icon:hover { background: var(--bg-control-hover) !important; }

.modal-v2-footer {
  background: var(--bg-subtle) !important;
  border-top: 1px solid var(--border) !important;
}

.modal-tabs {
  background: var(--bg-card) !important;
  border-bottom: 2px solid var(--border) !important;
  min-height: 2.875rem !important;
  overflow-y: hidden !important;
  align-items: center !important;
}

.modal-tab {
  color: var(--text-secondary) !important;
  border-bottom: none !important;
  margin-bottom: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
}

.modal-tab:hover { color: var(--text) !important; background: var(--bg-control-hover) !important; }

.modal-tab.active {
  color: var(--accent) !important;
  font-weight: 600 !important;
  border-bottom-color: transparent !important;
}

.modal-tab.active::after { background: var(--accent) !important; }

.object-summary {
  background: var(--bg-subtle) !important;
  border-bottom: 1px solid var(--border) !important;
}

.object-summary-info h3 { color: var(--text) !important; }

/* Progress / budsjett */
.progress-track { background: #eaeaea !important; }

.progress-fill {
  background: var(--accent) !important;
}

.progress-track.over-budget .progress-fill { background: var(--danger) !important; }

/* Skjemafelt – Win11 controls */
.win-input,
.form-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.form-modal select,
.form-modal textarea,
.search-input {
  background: var(--bg-control) !important;
  border: 1px solid var(--border-strong) !important;
  border-bottom-color: var(--border-strong) !important;
  border-radius: var(--radius) !important;
  box-shadow: none !important;
}

.win-input:hover,
.form-modal input:hover,
.form-modal select:hover,
.form-modal textarea:hover {
  border-color: var(--text-muted) !important;
  background: var(--bg-control-hover) !important;
}

.win-input:focus,
.form-modal input:focus,
.form-modal select:focus,
.form-modal textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(0, 95, 184, 0.2) !important;
  outline: none !important;
}

.win-check input[type="checkbox"] { accent-color: var(--accent) !important; }

.auth-form input,
.auth-form select,
.onboarding-form input,
.onboarding-form select {
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius) !important;
  background: var(--bg-control) !important;
}

.auth-form input:focus,
.onboarding-form input:focus,
.onboarding-form select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(0, 95, 184, 0.2) !important;
  outline: none !important;
}

.lang-btn {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
}

.lang-btn.selected {
  border-color: var(--accent) !important;
  background: var(--accent-subtle) !important;
  color: var(--accent) !important;
}

.dealer-edit { color: var(--accent) !important; }

.settings-fieldset {
  background: var(--bg-subtle) !important;
  border-color: var(--border) !important;
  border-radius: var(--radius) !important;
}

/* Innstillinger med sidemeny */
.settings-page-header { margin-bottom: 0.75rem; }
.settings-page-header h1 { margin: 0; font-size: 1.25rem; }

.page-header {
  margin-bottom: 1rem;
}
.page-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-header h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.page-header-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 42rem;
}
.page-header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.page-total-bar {
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem !important;
}
.page-total-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-total-label {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.page-total-value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.page-total-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.page-total-filtered { font-size: 0.78rem; }

.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  align-items: start;
  max-width: 920px;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: sticky;
  top: 0.75rem;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.settings-nav-item:hover {
  background: var(--bg-control);
  color: var(--text);
}

.settings-nav-item.active {
  background: var(--accent-subtle);
  color: var(--accent);
  font-weight: 600;
}

.settings-nav-icon { font-size: 1rem; line-height: 1; }

.settings-panel { min-width: 0; }

.settings-panel .settings-card { max-width: none; }

/* Kompakt 1:1-stripe på dashboard */
.fleet-length-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.fls-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  background: var(--accent-subtle);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.fls-item strong { color: var(--text); font-weight: 600; }
.fls-sep { color: var(--text-muted); opacity: 0.6; }
.fls-total strong { color: var(--accent); }

/* Grupperte skjemaer */
.form-section {
  margin-bottom: 0.55rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.form-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.form-section.image-upload-box { border-bottom: none; }

.form-section-title {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.form-grid.compact {
  gap: 0.45rem 0.65rem;
}

.form-grid.compact label {
  font-size: 0.78rem;
}

.form-grid.compact input,
.form-grid.compact select,
.form-grid.compact textarea {
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
}

.tag.tag-muted {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Flere kolonner i skjema */
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); gap: 0.4rem 0.65rem; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .full { grid-column: 1 / -1; }

@media (max-width: 820px) {
  .form-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .form-grid.cols-3 .span-2 { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: 1 / -1; }
}

/* Kjøpsliste – forhandler + pris */
.item-row-aside {
  text-align: right;
  flex-shrink: 0;
  min-width: 120px;
  max-width: 42%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.item-row-purchase {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.2rem 0.35rem;
  font-size: 0.82rem;
  line-height: 1.3;
}

.item-meta-store { color: var(--text-secondary); font-weight: 500; }
.item-meta-price { color: var(--price-orange); font-size: 0.95rem; font-weight: 800; }
.meta-sep { color: var(--text-muted); opacity: 0.55; }
.item-row-extra { color: var(--text-muted); font-size: 0.72rem; line-height: 1.3; }

.dealer-info h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dealer-info .star-display { font-size: 0.78rem; }

/* Stjerner – visning og valg */
.star-display { display: inline-flex; gap: 0.05rem; vertical-align: middle; }
.star-display .star { font-size: 0.85rem; line-height: 1; position: relative; }
.star-display .star.full { color: #f59e0b; }
.star-display .star.empty { color: #d1d5db; }
.star-display .star.half { color: #d1d5db; }
.star-display .star.half::before {
  content: '★';
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
  color: #f59e0b;
}

.star-picker { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.star-picker-track { display: inline-flex; gap: 0.1rem; }
.star-slot {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-block;
}
.star-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #d1d5db;
  pointer-events: none;
}
.star-slot.full .star-glyph { color: #f59e0b; }
.star-slot.half .star-glyph {
  background: linear-gradient(90deg, #f59e0b 50%, #d1d5db 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.star-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 1;
}
.star-hit.left { left: 0; }
.star-hit.right { right: 0; }
.star-picker-label { font-size: 0.78rem; color: var(--text-muted); min-width: 1.5rem; }

/* Innstillinger – kompakt listevisning */
.list-display-grid { display: flex; flex-direction: column; gap: 0.3rem; }
.list-display-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.35rem 0.5rem;
  align-items: start;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--border);
}
.list-display-row:last-child { border-bottom: none; }
.list-display-type-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 0.2rem;
}
.list-display-chips { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.list-chip { display: inline-flex; cursor: pointer; margin: 0; }
.list-chip input { position: absolute; opacity: 0; pointer-events: none; }
.list-chip span {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  font-size: 0.68rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-control);
  color: var(--text-secondary);
  line-height: 1.3;
}
.list-chip input:checked + span {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Kompakte inline-skjemaer */
.form-section.tight { margin-bottom: 0.45rem; padding-bottom: 0.35rem; }
.inline-field-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem 0.5rem;
  align-items: end;
}
.inline-field-row.cols-4 { grid-template-columns: repeat(4, 1fr); }
.inline-field-row.rating-row {
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.4rem 0.5rem;
}
.inline-field-row .span-2 { grid-column: span 2; }
.inline-field-row .grow { grid-column: 1 / -1; }
.inline-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
  min-width: 0;
}
.inline-field input,
.inline-field select,
.inline-input {
  padding: 0.28rem 0.4rem;
  font-size: 0.8rem;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
}
.inline-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.input-row.compact { gap: 0.25rem; }
.input-row.compact .btn-sm { padding: 0.2rem 0.45rem; min-height: 26px; }
.receipt-zone.compact { padding: 0.45rem 0.65rem; font-size: 0.78rem; margin: 0; }
.star-picker-sm .star-slot { width: 1.1rem; height: 1.1rem; }
.star-picker-sm .star-glyph { font-size: 1rem; }
.star-picker-sm .star-picker-label { font-size: 0.72rem; }

@media (max-width: 720px) {
  .inline-field-row,
  .inline-field-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .inline-field-row .span-2 { grid-column: 1 / -1; }
  .list-display-row { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav {
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
  }
  .settings-nav-item { width: auto; flex: 1 1 auto; justify-content: center; }
  .settings-nav-icon { display: none; }
}

/* Økonomi & årssammenligning */
.text-success { color: #15803d; }

.yoy-card { margin-bottom: 1rem; }
.yoy-highlight {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.yoy-stat {
  padding: 0.65rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.yoy-label { display: block; font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.2rem; }

.economy-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.economy-year-select {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.economy-year-select select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.economy-grand-totals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
}
.eco-total-box {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.eco-total-box span { display: block; font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.eco-total-box strong { font-size: 1.05rem; }
.eco-total-box.highlight { background: var(--accent-subtle); border-color: var(--accent); }

.economy-month-block {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.economy-month-block:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.economy-months-card { padding-top: 0.75rem; }
.economy-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}
.economy-month-head h3 { margin: 0; font-size: 0.95rem; font-weight: 700; }
.economy-month-totals { display: flex; flex-wrap: wrap; gap: 0.5rem 0.85rem; font-size: 0.78rem; align-items: center; justify-content: flex-end; }
.eco-out { color: var(--danger); }
.eco-in { color: #15803d; }

.economy-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.economy-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.economy-table col.eco-col-date { width: 6.5rem; }
.economy-table col.eco-col-where { width: 26%; }
.economy-table col.eco-col-amount { width: 7.5rem; }
.economy-table col.eco-col-action { width: 2.25rem; }

.economy-table th,
.economy-table td {
  padding: 0.45rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.economy-table th {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--bg-subtle);
}
.economy-table tbody tr:last-child td { border-bottom: none; }

.eco-col-date { white-space: nowrap; }
.eco-desc-inner {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.eco-desc-inner .eco-type { flex-shrink: 0; }
.eco-desc-inner .eco-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eco-col-where {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eco-col-amount,
.economy-table th.eco-col-amount {
  text-align: right !important;
  white-space: nowrap;
}
.eco-col-action { text-align: center; padding-left: 0.25rem; padding-right: 0.25rem; }

.eco-amount.out { color: var(--danger); font-weight: 600; }
.eco-amount.in { color: #15803d; font-weight: 600; }
.economy-table.compact td { padding: 0.35rem 0.5rem; }
.eco-type {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-right: 0.25rem;
}
.eco-type.eco-buy { background: #fef2f2; color: var(--danger); }
.eco-type.eco-sell { background: #f0fdf4; color: #15803d; }

.sale-form {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-subtitle { margin: 0 0 0.65rem; font-size: 0.95rem; }
.economy-footnote { margin-top: 0.75rem; padding: 0 0.25rem; }

.collection-link {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.collection-link:hover { opacity: 0.85; }

.collection-group-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.collection-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.collection-group-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border: none;
  background: var(--bg-subtle);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.collection-group-head:hover { background: var(--bg-control-hover); }

.group-head-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  min-width: 0;
}

.group-chevron {
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 1rem;
  flex-shrink: 0;
}

.group-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.group-count {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.group-stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.group-total {
  font-weight: 800;
  color: var(--price-orange);
  font-size: 0.95rem;
  flex-shrink: 0;
  min-width: 6.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.group-head-right {
  display: grid;
  grid-template-columns: 2.35rem minmax(6.75rem, auto);
  align-items: center;
  column-gap: 0.75rem;
  flex-shrink: 0;
}

.group-head-right:not(:has(.group-spend-share)) {
  grid-template-columns: minmax(6.75rem, auto);
  column-gap: 0;
}

.collection-group-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem;
}

.collection-group-body.collapsed { display: none; }

.collapse-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.collapse-toolbar-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-right: 0.15rem;
}

.btn-xs {
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  min-height: 1.65rem;
}

.collapsible-section {
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
}

.collapsible-section.card {
  padding: 0;
}

.collapsible-section-head {
  border-radius: 0;
}

.collapsible-section-body {
  padding: 0.85rem 0.95rem;
}

.collapsible-section-body.collapsed,
.economy-month-body.collapsed {
  display: none;
}

.dash-sections-wrap .collapsible-section .dash-kpi-row,
.dash-sections-wrap .collapsible-section .dash-inv-row,
.dash-sections-wrap .collapsible-section .dash-insurance-row {
  margin-bottom: 0;
}

.dash-recent-card .collapsible-section-body {
  padding-top: 0.35rem;
}

.economy-months-toolbar {
  margin-bottom: 0.65rem;
}

.economy-month-toggle {
  margin-bottom: 0.35rem;
  border-radius: var(--radius-md);
}

.economy-month-toggle .economy-month-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  font-size: 0.78rem;
  align-items: center;
  justify-content: flex-end;
}

.economy-month-body {
  padding-bottom: 0.35rem;
}

.collection-group-body .item-row {
  border-radius: var(--radius);
}

.collection-filter-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.65rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.filter-sub-tabs {
  margin-top: -0.35rem;
  margin-bottom: 0.85rem;
  padding-left: 0.15rem;
}

.filter-sub-tabs .filter-tab {
  font-size: 0.82rem;
  padding: 0.3rem 0.65rem;
}

.item-row-sold .sold-thumb {
  font-size: 1.35rem;
  background: var(--accent-subtle);
}

.sold-note {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
}

.sold-delete-btn {
  margin-top: 0.35rem;
  font-size: 0.78rem;
}

.sale-detail-hero {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.75rem 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.sale-detail-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.sale-detail-price {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--price-orange, var(--accent));
}

.sale-detail-date {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}

.item-row-sold:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sale-profit-pos { color: var(--success, #15803d); }
.sale-profit-neg { color: var(--danger, #b91c1c); }

.input-row.compact .grow { flex: 1; min-width: 0; }

.collection-link-row {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.installed-decoder-banner {
  padding: 0.5rem 0.65rem;
  margin-bottom: 0.65rem;
  background: var(--accent-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
}

.decoder-inventory-grid .decoder-mounted-cell,
.decoder-loco-grid .decoder-mounted-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0 0 0.65rem !important;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.decoder-mounted-value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.4rem;
  min-height: 32px;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.25;
}
.decoder-mounted-value .collection-link { font-size: 0.85rem; font-weight: 600; }
.decoder-mounted-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.decoder-flags-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 1rem;
}
.decoder-flags-row .win-check { margin: 0; white-space: nowrap; }

.decoder-addr-field {
  flex: 0 0 auto;
  margin: 0 !important;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.decoder-addr-field input,
.decoder-loco-grid .decoder-addr-field input {
  width: 5rem;
  max-width: 100%;
  min-height: 32px;
  padding: 0.35rem 0.45rem;
}

.decoder-loco-grid label.decoder-addr-field {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Spending breakdown (Økonomi) */
.spend-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
@media (max-width: 820px) {
  .spend-breakdown-grid { grid-template-columns: 1fr; }
}
.spend-breakdown-card.compact {
  padding: 0.7rem 0.85rem;
  margin-bottom: 0;
}
.spend-breakdown-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.spend-breakdown-card .card-subtitle {
  margin: 0;
  font-size: 0.88rem;
}
.spend-breakdown-sum {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--price-orange);
  white-space: nowrap;
}
.spend-breakdown-hint {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.spend-empty { font-size: 0.82rem; margin: 0.25rem 0 0; }
.spend-breakdown-list { display: flex; flex-direction: column; gap: 0.45rem; }
.spend-row.main { padding-bottom: 0; }
.spend-row-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.78rem;
  margin-bottom: 0.15rem;
}
.spend-row-label { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spend-row-meta { color: var(--text-secondary); font-size: 0.72rem; text-align: right; flex-shrink: 0; }
.spend-bar {
  height: 0.35rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
}
.spend-bar.sub { height: 0.28rem; opacity: 0.85; }
.spend-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--price-orange));
  min-width: 2px;
}
.spend-children {
  margin: 0.25rem 0 0 0.65rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.group-type-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.group-spend-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  width: 2.35rem;
  height: 2.35rem;
  overflow: hidden;
  justify-self: center;
}
.group-spend-ring {
  width: 2.35rem;
  height: 2.35rem;
  transform: rotate(-90deg);
}
.group-spend-ring .ring-bg {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 18%, var(--border));
  stroke-width: 3;
}
.group-spend-ring .ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
}
.group-spend-pct-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.02rem;
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  pointer-events: none;
}
.group-spend-pct-num {
  min-width: 1.55rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.group-spend-pct-sign {
  font-size: 0.48rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Category settings */
.category-settings-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.category-groups-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.category-group-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  background: var(--bg-subtle);
}
.category-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.category-group-head h3 {
  margin: 0;
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.category-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.88rem;
}
.category-tree-item {
  display: block;
  font-size: 0.88rem;
}
.category-list-nested {
  list-style: none;
  margin: 0.25rem 0 0.35rem;
  padding: 0 0 0 0.85rem;
  border-left: 2px solid var(--border);
}
.category-tree-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  width: 100%;
}
.category-tree-name { font-weight: 600; }
.category-tree-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-left: auto;
}
.item-cat-field-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.item-cat-field-row select { flex: 1; min-width: 0; }
.item-quick-add-bar { margin-top: 0.35rem; }
.quick-text-popover {
  position: fixed;
  inset: 0;
  z-index: 2500;
  pointer-events: auto;
}
.quick-text-popover-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.18);
  z-index: 0;
}
.quick-text-popover-panel {
  position: fixed;
  z-index: 1;
  width: min(260px, calc(100vw - 24px));
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card, #fff);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.12));
}
.quick-text-popover-title {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.quick-text-popover-input {
  width: 100%;
  min-height: 34px;
  font-size: 0.85rem;
}
.quick-text-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.item-trait-settings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.item-trait-settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
}
.item-trait-settings-row > span:first-child { font-weight: 600; min-width: 6rem; }
.category-traits-card { margin-bottom: 1rem; }
.tag-trait { background: color-mix(in srgb, var(--accent) 12%, var(--bg-subtle)); color: var(--accent); }

.item-length-steam.span-full { grid-column: 1 / -1; }
.item-length-steam-grid { margin-bottom: 0; }
.item-length-standard-pair { display: contents; }

/* Wishlist */
.wishlist-summary-card {
  padding: 0.85rem 1.1rem !important;
  margin-bottom: 0.75rem !important;
}

.wishlist-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.wishlist-summary-label {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wishlist-summary-value {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--price-orange);
  line-height: 1.2;
}

.wishlist-summary-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.anyrail-import-card { padding: 0.75rem 0.95rem !important; margin-bottom: 0.75rem !important; }
.anyrail-import-details > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  list-style: none;
  margin-bottom: 0.35rem;
}
.anyrail-import-details > summary::-webkit-details-marker { display: none; }
.anyrail-import-details[open] > summary { margin-bottom: 0.5rem; }
.anyrail-paste {
  width: 100%;
  min-height: 6.5rem;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.35;
  margin-top: 0.35rem;
}
.anyrail-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.text-import-template-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0;
}

.text-import-file-btn { cursor: pointer; margin: 0; }

.text-import-file-btn input { display: none; }

.anyrail-preview-wrap {
  margin-top: 0.65rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.anyrail-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.anyrail-preview-table th,
.anyrail-preview-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.anyrail-preview-table th {
  background: var(--bg-subtle);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.anyrail-preview-table tbody tr:last-child td { border-bottom: none; }
.anyrail-preview-table .anyrail-qty {
  width: 3.25rem;
  padding: 0.25rem 0.35rem;
  min-height: 0;
}
.anyrail-name { font-weight: 600; color: var(--text); }
.anyrail-muted { color: var(--text-muted); font-size: 0.74rem; }

.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.wishlist-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.wishlist-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: flex-start;
}
.wishlist-card-head h3 { margin: 0; font-size: 0.95rem; }
.wishlist-meta { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--text-muted); }
.wishlist-card-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.wishlist-price-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  flex-shrink: 0;
}
.wishlist-qty {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.wishlist-est { color: var(--price-orange); font-size: 1rem; line-height: 1.15; }
.wishlist-home-hint {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.2;
}
.wishlist-sum-home-hint {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
}
.wishlist-vat-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 0.1rem 0 0.25rem;
}
.wishlist-vat-check { margin: 0; font-size: 0.78rem; }
.wishlist-vat-hint { margin: 0; font-size: 0.72rem; flex: 1; min-width: 12rem; }
.wishlist-store { display: flex; flex-direction: column; gap: 0.12rem; align-items: flex-start; }
.wishlist-unit { font-size: 0.76rem; }
.tag.tag-green { background: #e8f5e9; color: #2e7d32; }
.tag.tag-sm { font-size: 0.68rem; padding: 0.08rem 0.35rem; vertical-align: middle; }
.wishlist-ship, .wishlist-notes { margin: 0; font-size: 0.78rem; color: var(--text-secondary); }
.wishlist-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.25rem; }
.ship-check { display: flex; align-items: flex-end; padding-bottom: 0.35rem; }

/* Wishlist modal */
.wishlist-modal {
  max-width: 680px;
}
.wishlist-modal .win-form {
  padding: 1.15rem 1.4rem 1.3rem;
  gap: 0;
}
.wishlist-modal-footer {
  padding: 0.85rem 1.4rem !important;
}
.wishlist-form .form-section {
  margin-bottom: 0.95rem;
  padding-bottom: 0.75rem;
}
.wishlist-form .form-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.wishlist-form .form-section-title {
  margin-bottom: 0.55rem;
}
.wishlist-form .inline-field-row {
  gap: 0.5rem 0.75rem;
}
.wishlist-form input[readonly] {
  background: var(--bg-subtle);
  color: var(--text-secondary);
}
.wishlist-form label.win-check.ship-check {
  justify-content: flex-start;
  padding-bottom: 0.15rem;
}

/* Manufacturers */
.manufacturer-page-card { padding-top: 0.85rem; }
.manufacturer-intro {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.manufacturer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.75rem;
}
.manufacturer-sort-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.manufacturer-sort-label select { min-width: 9.5rem; }
.manufacturer-toolbar .btn.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}
.manufacturer-result-count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}
.manufacturer-filter-panel {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
}
.manufacturer-filter-panel.hidden { display: none; }
.manufacturer-filter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.82rem;
}
.manufacturer-filter-actions { display: flex; gap: 0.35rem; }
.manufacturer-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
}
.manufacturer-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  cursor: pointer;
  user-select: none;
}
.manufacturer-filter-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: 999px;
  padding: 0.05rem 0.35rem;
}
.country-flag-img,
.manufacturer-flag-img {
  display: inline-block;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  vertical-align: middle;
}
.manufacturer-card-media .manufacturer-flag-img {
  width: 1.75rem;
  height: auto;
  box-shadow: none;
}
.manufacturer-location-line {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.country-flag-inline { flex-shrink: 0; }
.manufacturer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.65rem;
}
.manufacturer-card {
  display: grid;
  grid-template-columns: 3.25rem 1fr auto;
  gap: 0.75rem;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.8rem 0.85rem;
  background: var(--bg-card);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.manufacturer-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.manufacturer-card-media {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.manufacturer-card-media img { width: 100%; height: 100%; object-fit: contain; padding: 0.2rem; }
.manufacturer-flag { font-size: 1.65rem; line-height: 1; }
.manufacturer-card-body { min-width: 0; }
.manufacturer-card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.15rem;
}
.manufacturer-card-head h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
}
.manufacturer-std {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
}
.manufacturer-location {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
}
.manufacturer-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.manufacturer-link:hover { text-decoration: underline; }
.manufacturer-link.muted { color: var(--text-muted); font-weight: 500; }
.manufacturer-edit-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.1rem 0.15rem;
  opacity: 0.55;
  border-radius: var(--radius);
  align-self: center;
}
.manufacturer-edit-btn:hover { opacity: 1; background: var(--bg-subtle); }

/* Manufacturer modal */
.mfr-modal .modal-v2-body {
  padding: 0.75rem 1rem 0.85rem;
}
.mfr-modal-footer {
  padding: 0.65rem 1rem !important;
  justify-content: space-between;
  align-items: center;
}
.mfr-form { display: flex; flex-direction: column; gap: 0.65rem; }
.mfr-form.compact { gap: 0.55rem; }
.mfr-form-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.85rem;
  align-items: start;
}
.mfr-form-block { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.mfr-form-row {
  display: grid;
  grid-template-columns: minmax(8rem, 9.5rem) 1fr;
  gap: 0.45rem;
  align-items: start;
}
.mfr-form-row.compact { gap: 0.4rem; }
.mfr-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.mfr-label.full { grid-column: 1 / -1; }
.mfr-label.flex { min-width: 0; }
.mfr-country-picker {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mfr-country-flag {
  width: 1.35rem;
  height: auto;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.mfr-country-picker select { flex: 1; min-width: 0; }
.mfr-logo-block {
  border-top: 1px solid var(--border);
  padding-top: 0.55rem;
}
.mfr-logo-block.compact { padding-top: 0.45rem; }
.mfr-logo-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}
.mfr-logo-row.compact { gap: 0.55rem; }
.mfr-logo-preview {
  width: 3.5rem;
  height: 3.5rem;
  flex-shrink: 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.mfr-logo-preview img { width: 100%; height: 100%; object-fit: contain; padding: 0.25rem; }
.mfr-logo-empty { font-size: 1.5rem; line-height: 1; opacity: 0.85; }
.mfr-logo-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mfr-logo-file-btn { align-self: flex-start; }

@media (max-width: 720px) {
  .mfr-form-columns { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .mfr-form-row { grid-template-columns: 1fr; }
  .manufacturer-card { grid-template-columns: 2.75rem 1fr auto; }
}
.eco-shipping-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

@media (max-width: 720px) {
  .yoy-highlight,
  .economy-grand-totals { grid-template-columns: 1fr; }
}

/* ── Kompakte registreringsskjemaer (form-dense) ── */
.form-modal.form-dense .tab-panel { padding: 0.45rem 0.65rem !important; }
.form-modal.form-dense .modal-tab { padding: 0.4rem 0.55rem !important; min-height: 2rem !important; font-size: 0.76rem !important; }
.form-modal.form-dense .form-section { margin-bottom: 0.35rem; padding-bottom: 0.25rem; }
.form-modal.form-dense .form-section-title { margin-bottom: 0.3rem; font-size: 0.68rem; }
.form-modal.form-dense .form-hint,
.form-modal.form-dense .field-hint { margin: 0 0 0.25rem; font-size: 0.72rem; line-height: 1.3; }
.form-modal.form-dense .object-summary { padding: 0.45rem 0.6rem !important; margin-bottom: 0; }
.form-modal.form-dense .object-summary-thumb { width: 48px !important; height: 48px !important; }
.form-modal.form-dense .object-summary-info h3 { font-size: 0.92rem !important; margin: 0 0 0.15rem; }
.form-modal.form-dense .modal-v2-footer { padding: 0.45rem 0.75rem !important; }
.form-modal.form-dense label:not(.mfr-tag-chip):not(.win-check) { margin-bottom: 0.35rem !important; }
.form-modal.form-dense textarea { min-height: 44px !important; }
.form-modal.form-dense .receipt-zone { padding: 0.4rem 0.55rem; }
.form-modal.form-dense .decoder-pick.compact { margin-top: 0.25rem; }
.form-modal.form-dense .service-tab-wrap .form-section:last-child { margin-bottom: 0; }

/* Utskriftsknapp på inventar-rader */
.item-row-print {
  padding: 0.12rem 0.3rem !important;
  min-height: 22px !important;
  min-width: 26px;
  line-height: 1;
  font-size: 0.82rem;
  opacity: 0.55;
  align-self: flex-end;
}
.item-row:hover .item-row-print,
.item-row-print:focus-visible { opacity: 1; }
.item-row-aside { gap: 0.08rem; }
