/* .btn og .pagination-row har display:… !important og overstyrer hidden-attributtet.
   (Ikke en global [hidden]-regel: CE.loading.inline viser elementer med hidden via .show().) */
.btn[hidden], .pagination-row[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════
   CloudEconomy komponentbibliotek (ce-components.css) – eldre lag.
   Nye, flate komponenter (seksjon, tallrad, statuslinje, verktøylinje,
   faner, merker, tilstander) ligger i ce-ui.css, som lastes sist.
   Komponenter her: .ce-seg, .ce-pill, .ce-field, .ce-side-card m.fl.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Shell: mørk sidebar i begge tema ── */
body .sidebar {
  background: #0B1526 !important;
  border-right: 1px solid rgba(255,255,255,.06) !important;
  width: 232px !important;
}
body .sidebar-brand { border-bottom: 1px solid rgba(255,255,255,.07) !important; }
body .brand-name { color: #EAF1FA !important; }
body .brand-name small { color: #7F95AF !important; } /* batch 11: 5,5:1 mot sidemenyen #0F1E31 (var 3,4:1) */

/* Seksjonslabel */
body .nav-label {
  color: #7F95AF !important; /* batch 11: 5,5:1 mot sidemenyen #0F1E31 (#6F86A0 ga 4,47:1 etter at menyen ble #0F1E31) */
  font-size: 10px !important;
  letter-spacing: .12em !important;
}

/* Modul-lenker */
body .nav-link {
  color: #93A6BC !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  height: 38px !important;
}
body .nav-link:hover { background: rgba(255,255,255,.06) !important; color: #EAF1FA !important; }
body .nav-link.active,
body .cloud-sidebar-module.active {
  background: rgba(59,110,246,.22) !important;
  color: #fff !important;
  box-shadow: inset 2px 0 0 #3B6EF6 !important;
}
body .nav-link .icon, body .nav-link svg.icon { opacity: .85 !important; }
body .nav-chevron { display: none !important; }

/* Sub-lenker: prikk + tekst, ingen boks */
body .cloud-sub-menu { padding-left: 20px !important; }
body .nav-link.cloud-sub-link {
  height: 32px !important;
  font-size: 12.5px !important;
  color: #7E94AB !important;
  background: transparent !important;
  box-shadow: none !important;
}
body .nav-link.cloud-sub-link:hover { color: #EAF1FA !important; background: transparent !important; }
body .nav-link.cloud-sub-link.active { color: #fff !important; background: rgba(59,110,246,.18) !important; box-shadow: none !important; }
body .nav-link.cloud-sub-link .icon { display: none !important; }
body .nav-link.cloud-sub-link::before {
  content: '' !important;
  width: 4px !important; height: 4px !important; border-radius: 50% !important;
  background: currentColor !important; opacity: .55 !important; flex-shrink: 0 !important;
}
body .nav-badge {
  background: rgba(245,158,11,.2) !important;
  color: #F5B544 !important;
  font-size: 10px !important;
}

/* Sidebar-bunn: foretak + bruker */
body .sidebar-footer { border-top: 1px solid rgba(255,255,255,.07) !important; }
body .cloud-enterprise-switch {
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.1) !important;
  color: #C6D5E5 !important;
}
body .sidebar-user-info .name, body .sidebar-user-info strong { color: #fff !important; }
body .sidebar-user-info .role, body .sidebar-user-info span { color: #7E94AB !important; }
body .sidebar-logout { color: #7E94AB !important; }
body .sidebar-logout:hover { color: #fff !important; }

/* ── Topbar med modul-tabs ── */
body .topbar { height: 60px !important; min-height: 60px !important; }
body .main { padding-top: 60px !important; }

/* ── Sidehode: kicker + tittel + handlinger ── */
.ce-kicker {
  font-size: 11px !important; font-weight: 700 !important;
  letter-spacing: .1em !important; color: var(--v2-blue-fg) !important; /* batch 8: AA også i mørkt tema */
  text-transform: uppercase !important; margin-bottom: 2px !important;
}
body .phb-title { font-size: 24px !important; }

/* ── Login split-screen ── */
body.login-page {
  /* batch 12: samme verdier som login.css (--l-*), referert i stedet for gjentatt (hex-taket i ui_guard_smoke) */
  --v2-blue: var(--l-blue);
  --v2-surface: var(--l-surface);
  --v2-surface-2: var(--l-bg);
  --v2-border: var(--l-border);
  --v2-text: var(--l-text);
  --v2-text-2: var(--l-text-2);
  --v2-text-3: #586B81; /* batch 12: #96A8BE ga 2,4:1 (fotnote, plassholder); nå 5,5:1 mot hvit */
  --v2-blue-s: #EEF2FE;
  --ce-field-border: #828D9F; /* 3,4:1 mot hvit (feltkanten #DDE3EE ga 1,3:1) */
  --ce-focus: var(--v2-blue);
  --ce-login-eyebrow: var(--v2-blue);
}
@media (prefers-color-scheme: dark) {
  body.login-page {
    --v2-surface: #101A2C;
    --v2-surface-2: #16233A;
    --v2-border: #26344E;
    --v2-text: #EAF1FA;
    --v2-text-2: #8CA0B8;
    --v2-text-3: #8299B5; /* batch 12: #5E728E ga 3,5:1; nå 6,0:1 mot panelet */
    --v2-blue-s: #16295E;
    --ce-field-border: #607491; /* 3,7–3,8:1 mot panelet og feltet (#26344E ga 1,4:1) */
    --ce-focus: #6B93FF; /* 6,0–6,3:1 (#2B5EF6 ga 3,3:1) */
    --ce-login-eyebrow: var(--ce-focus); /* «Innlogging», 11 px: 6,0:1 (#2B5EF6 ga 3,3:1) */
  }
  body.login-page .login-header h2 { color: var(--v2-text) !important; }
  body.login-page .login-header p { color: var(--v2-text-2) !important; }
  body.login-page .login-field label { color: var(--v2-text-2) !important; }
  body.login-page .login-field input {
    background: #0B1526 !important;
    color: var(--v2-text) !important;
  }
  body.login-page .login-help { color: var(--v2-text-2) !important; }
}
body.login-page { background: #060D18 !important; }
body.login-page .login-shell { min-height: 100vh !important; padding: 0 !important; }
body.login-page .login-grid {
  min-height: 100vh !important;
  border-radius: 0 !important; overflow: hidden !important;
  display: grid !important; grid-template-columns: 1fr 1.1fr !important;
}
body.login-page .login-brand {
  background:
    radial-gradient(480px 300px at 70% 100%, rgba(43,94,246,.35), transparent 70%),
    repeating-linear-gradient(0deg, rgba(120,150,200,.07) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(90deg, rgba(120,150,200,.07) 0 1px, transparent 1px 56px),
    #0B1526 !important;
  padding: 56px !important;
}
body.login-page .login-brand-head h1 { color: #fff !important; font-size: 32px !important; letter-spacing: -.5px !important; max-width: 380px !important; }
body.login-page .login-brand-head p { color: #8CA0B8 !important; }
body.login-page .login-brand-badge span {
  background: var(--v2-blue) !important; border-radius: 10px !important;
  width: 38px !important; height: 38px !important;
  display: inline-grid !important; place-items: center !important;
  color: #fff !important; font-weight: 800 !important;
}
body.login-page .login-point i {
  width: 7px !important; height: 7px !important; min-width: 7px !important;
  border-radius: 50% !important; background: var(--v2-blue) !important;
  font-size: 0 !important; padding: 0 !important; margin-top: 6px !important;
}
body.login-page .login-point div strong { color: #EAF1FA !important; }
body.login-page .login-point div span { color: #8CA0B8 !important; }
body.login-page .login-brand-footer { color: #7F95AF !important; } /* batch 12: #5E728E ga 3,7:1 mot #0B1526; nå 5,9:1 */
body.login-page .login-panel { background: var(--v2-surface) !important; }
body.login-page .login-card { max-width: 400px !important; border: 0 !important; box-shadow: none !important; background: transparent !important; }
body.login-page .eyebrow { color: var(--ce-login-eyebrow, var(--v2-blue)) !important; }
/* Batch 12: feltkant 3:1 (WCAG 1.4.11) og fokus i fokusfargen (i mørkt tema satt den mørke kanten seg også på fokus). */
body.login-page .login-field input:not(:focus) { border-color: var(--ce-field-border) !important; }
body.login-page .login-field input:focus { border-color: var(--ce-focus) !important; box-shadow: 0 0 0 1px var(--ce-focus) !important; outline: none !important; }
body.login-page .login-field input::placeholder { color: var(--v2-text-3) !important; opacity: 1; }
body.login-page .login-header h2 { font-size: 28px !important; letter-spacing: -.5px !important; }
body.login-page .login-field label {
  font-size: 11px !important; font-weight: 700 !important;
  letter-spacing: .08em !important; text-transform: uppercase !important;
  color: var(--v2-text-2) !important;
}
body.login-page .login-field input {
  height: 46px !important; border-radius: 10px !important; font-size: 14px !important;
}
body.login-page .login-btn { height: 48px !important; border-radius: 10px !important; font-size: 15px !important; width: 100% !important; }
body.login-page .login-note { text-align: center !important; color: var(--v2-text-3) !important; font-size: 12px !important; }
@media (max-width: 900px) {
  body.login-page .login-grid { grid-template-columns: 1fr !important; }
  body.login-page .login-brand { display: none !important; }
}

/* ── Dashboard ── */
.dash-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 320px !important;
  gap: 20px !important; align-items: start !important;
}
.dash-main, .dash-side {
  display: flex !important; flex-direction: column !important;
  gap: 20px !important; min-width: 0 !important;
}
body .ce-panel {
  background: var(--v2-surface) !important;
  border: 1px solid var(--v2-border) !important;
  border-radius: 12px !important;
  box-shadow: var(--v2-shadow-sm) !important;
  overflow: hidden !important;
}
body .dash-panel-head {
  display: flex !important; align-items: center !important; justify-content: space-between !important;
  gap: 12px !important; padding: 16px 20px !important;
  border-bottom: 1px solid var(--v2-border) !important;
}
body .dash-panel-head h2, body .dash-panel-head h3 {
  margin: 0 !important; font-size: 15px !important; font-weight: 700 !important; color: var(--v2-text) !important;
}
body .dash-panel-sub { margin: 2px 0 0 !important; font-size: 12px !important; color: var(--v2-text-3) !important; }
body .dash-see-all { font-size: 12px !important; font-weight: 600 !important; color: var(--v2-text-2) !important; text-decoration: none !important; }
body .dash-see-all:hover { color: var(--v2-blue-fg) !important; }
body .panel-body { padding: 20px !important; }
body #dash-chart-canvas { max-height: 260px !important; }

/* KPI-kort med farget topplinje */
body .dash-kpi-card { border-top: 3px solid var(--v2-blue) !important; }
body .dash-kpi-card.kpi-paid { border-top-color: var(--v2-green) !important; }
body .dash-kpi-card.kpi-pending { border-top-color: var(--v2-amber) !important; }
body .dash-kpi-card.kpi-overdue { border-top-color: var(--v2-red) !important; }
body .dkc-label {
  font-size: 11px !important; font-weight: 700 !important;
  letter-spacing: .07em !important; text-transform: uppercase !important;
  color: var(--v2-text-2) !important;
}

/* Siste fakturaer-rader */
body .recent-invoice-row {
  display: flex !important; align-items: center !important; gap: 12px !important;
  padding: 14px 20px !important; text-decoration: none !important;
  border-bottom: 1px solid var(--v2-border-2) !important;
}
body .recent-invoice-row:last-child { border-bottom: 0 !important; }
body .recent-invoice-row:hover { background: var(--v2-surface-2) !important; }
body .invoice-row-avatar {
  width: 38px !important; height: 38px !important; border-radius: 10px !important;
  display: grid !important; place-items: center !important;
  font-size: 12px !important; font-weight: 800 !important; color: #fff !important; flex-shrink: 0 !important;
}
body .invoice-row-avatar.blue { background: var(--v2-blue) !important; }
body .invoice-row-avatar.dark { background: var(--v2-sb) !important; }
body .invoice-row-avatar.danger { background: var(--v2-red) !important; }
body .invoice-row-avatar.warning { background: var(--v2-amber) !important; }
body .invoice-row-avatar.success { background: var(--v2-green) !important; }
body .invoice-row-avatar.info { background: var(--v2-teal) !important; }
body .recent-invoice-row > span:nth-child(2) { flex: 1 !important; min-width: 0 !important; display: flex !important; flex-direction: column !important; }
body .recent-invoice-row strong { font-size: 13px !important; font-weight: 600 !important; color: var(--v2-text) !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
body .recent-invoice-row small { font-size: 12px !important; color: var(--v2-text-3) !important; }
body .recent-invoice-row em { font-style: normal !important; font-size: 13px !important; font-weight: 700 !important; color: var(--v2-text) !important; white-space: nowrap !important; }

/* Hurtighandlinger */
body .dash-quick-actions { display: flex !important; flex-direction: column !important; gap: 8px !important; padding: 16px !important; }
body .dash-quick-actions .btn-block { width: 100% !important; justify-content: center !important; }

/* Statusfordeling stolper */
body .ce-status-bars { display: flex !important; flex-direction: column !important; gap: 12px !important; padding: 16px 20px 20px !important; }
body .ce-status-line > div { display: flex !important; justify-content: space-between !important; font-size: 12px !important; color: var(--v2-text-2) !important; margin-bottom: 5px !important; }
body .ce-status-line strong { color: var(--v2-text) !important; }
body .ce-status-line i {
  display: block !important; height: 5px !important; border-radius: 99px !important;
  background: var(--v2-border-2) !important; position: relative !important; overflow: hidden !important;
}
body .ce-status-line i::after {
  content: '' !important; position: absolute !important; inset: 0 auto 0 0 !important;
  width: var(--bar, 0%) !important; background: var(--color, var(--v2-blue)) !important; border-radius: 99px !important;
}

/* Varsler */
body .ce-notifications { padding: 8px !important; display: flex !important; flex-direction: column !important; gap: 4px !important; }
body .notification-row {
  display: flex !important; gap: 12px !important; align-items: flex-start !important;
  padding: 12px !important; border-radius: 10px !important;
}
body .notification-row:hover { background: var(--v2-surface-2) !important; }
/* Batch 8: tonen er en farget prikk (flatt), ikke en tonet boks med plassholdertegn «▤». */
body .notification-icon {
  width: 10px !important; height: 10px !important; margin-top: 4px !important; border-radius: 50% !important;
  flex-shrink: 0 !important; background: var(--v2-text-3) !important;
}
body .notification-icon.tone-0 { background: var(--v2-red) !important; }
body .notification-icon.tone-1 { background: var(--v2-amber) !important; }
body .notification-icon.tone-2 { background: var(--v2-blue) !important; }
body .notification-row > span:nth-child(2) { flex: 1 !important; min-width: 0 !important; display: flex !important; flex-direction: column !important; gap: 2px !important; }
body .notification-row strong { font-size: 13px !important; font-weight: 600 !important; color: var(--v2-text) !important; }
body .notification-row small { font-size: 12px !important; color: var(--v2-text-3) !important; }
body .notification-row em { font-style: normal !important; color: var(--v2-text-3) !important; }
body .invoice-empty-row { padding: 24px !important; text-align: center !important; color: var(--v2-text-3) !important; font-size: 13px !important; }

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr !important; }
}

/* ── Segmentert statistikk (.ce-seg): flyttet til ce-ui.css som tallrad (batch 5) ── */

/* ── Salgsrader som tabellinnhold ── */
body .ce-purch-group-title {
  padding: 14px 20px 6px !important;
  font-size: 11px !important; font-weight: 700 !important;
  letter-spacing: .07em !important; text-transform: uppercase !important;
  color: var(--v2-text-3) !important; background: transparent !important;
}
body a.ce-purch-notification-row:hover { background: var(--v2-surface-2) !important; }
body .ce-purch-row-meta { text-align: right !important; }
body .ce-purch-row-amount { font-size: 15px !important; }

/* Flate linjer på ny-faktura (ingen stripe-boks) */
.ce-section .invoice-line-labels {
  background: transparent !important; border-bottom: 1px solid var(--v2-border) !important;
  padding: 0 2px 8px !important; color: var(--v2-text-3) !important;
}
.ce-section .invoice-line { padding-left: 2px !important; padding-right: 2px !important; }

/* ── Pillefilter ── */
.ce-pill-row {
  display: flex !important; gap: 8px !important; flex-wrap: wrap !important;
  padding: 12px 20px 0 !important;
}
.ce-pill-row:empty { display: none !important; }
.ce-pill {
  appearance: none !important; height: 32px !important; padding: 0 14px !important;
  border-radius: 8px !important; border: 1px solid var(--v2-border) !important;
  background: var(--v2-surface) !important; color: var(--v2-text-2) !important;
  font-size: 12px !important; font-weight: 600 !important; font-family: inherit !important;
  cursor: pointer !important; white-space: nowrap !important;
}
.ce-pill:hover { border-color: var(--v2-blue) !important; color: var(--v2-text) !important; }
.ce-pill.active { background: var(--v2-blue) !important; border-color: var(--v2-blue) !important; color: #fff !important; }

/* ── Fakturatabell ── */
.ce-inv-head, body .ce-inv-row {
  display: grid !important;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto 24px !important;
  gap: 12px !important; align-items: center !important;
  padding-left: 20px !important; padding-right: 20px !important;
}
.ce-inv-head {
  padding-top: 12px !important; padding-bottom: 8px !important;
  font-size: 10.5px !important; font-weight: 700 !important;
  letter-spacing: .07em !important; text-transform: uppercase !important;
  color: var(--v2-text-3) !important;
  border-bottom: 1px solid var(--v2-border) !important;
}
.ce-inv-head .r { text-align: right !important; }
body .ce-inv-row {
  padding-top: 14px !important; padding-bottom: 14px !important;
  border-bottom: 1px solid var(--v2-border-2) !important;
  text-decoration: none !important; color: inherit !important;
}
body .ce-inv-row:hover { background: var(--v2-surface-2) !important; }
.ce-inv-cust { display: flex !important; align-items: center !important; gap: 12px !important; min-width: 0 !important; }
.ce-inv-cust > span:last-child { display: flex !important; flex-direction: column !important; min-width: 0 !important; }
.ce-inv-cust strong { font-size: 13px !important; font-weight: 600 !important; color: var(--v2-text) !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.ce-inv-cust small, .ce-inv-date small, .ce-inv-due small, .ce-inv-amt small { font-size: 11.5px !important; color: var(--v2-text-3) !important; }
.ce-inv-date, .ce-inv-due { display: flex !important; flex-direction: column !important; gap: 1px !important; font-size: 13px !important; color: var(--v2-text) !important; }
.ce-inv-due.is-over, .ce-inv-due.is-over small { color: var(--v2-red-fg) !important; font-weight: 600 !important; }
.ce-inv-due.is-over small { font-weight: 500 !important; }
.ce-inv-amt { display: flex !important; flex-direction: column !important; align-items: flex-end !important; }
.ce-inv-amt strong { font-size: 14px !important; font-weight: 700 !important; color: var(--v2-text) !important; white-space: nowrap !important; }
.ce-inv-menu { color: var(--v2-text-3) !important; letter-spacing: 1px !important; text-align: center !important; }
@media (max-width: 900px) {
  .ce-inv-head { display: none !important; }
  .ce-inv-head, body .ce-inv-row { grid-template-columns: minmax(0, 1fr) auto !important; }
  body .ce-inv-row .ce-inv-date, body .ce-inv-row .ce-inv-due, body .ce-inv-row .ce-inv-menu { display: none !important; }
}

/* Brede sider: bruk hele bredden */
body[data-page="invoice/create"] .page-wrapper { max-width: 1680px !important; }

/* ── Dokumenteditor (skjema + forhåndsvisning) ── */
.ce-doc-editor {
  display: grid !important;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr) !important;
  gap: 28px !important; align-items: start !important;
}
.ce-doc-form, .ce-doc-side { min-width: 0 !important; }
/* Fakturalinjen er én rad med kolonneetiketter (minst ~640 px) så lenge skjemaet er så bredt – på vanlig desktop (skjemaet
   får 1.3fr av editoren) og når editoren står i én kolonne. Først når skjemaet er smalere enn det, stables linjen i to
   kolonner og etikettraden skjules (feltene har egne plassholdere og aria-etiketter). */
.ce-doc-form { container-type: inline-size; }
@container (max-width: 640px) {
  .invoice-line-labels { display: none !important; }
  .invoice-line-main { grid-template-columns: 1fr 1fr !important; }
  .invoice-line-main > :first-child { grid-column: 1 / -1; }
  .line-total { justify-content: flex-start !important; }
}
/* Skillelinjen over første synlige seksjon (importbanneret er skjult) */
.ce-doc-form > #invoice-import-banner[style*="display:none"] + .ce-section, .ce-doc-form > #invoice-import-banner[style*="display: none"] + .ce-section { border-top: 0 !important; padding-top: 4px !important; }
@media (min-width: 1101px) {
  .ce-doc-side { position: sticky !important; top: 76px !important; }
}
@media (max-width: 1100px) {
  .ce-doc-editor { grid-template-columns: 1fr !important; }
}
.ce-doc-preview {
  background: var(--v2-surface) !important;
  border: 1px solid var(--v2-border) !important;
  border-radius: 12px !important;
  box-shadow: var(--v2-shadow) !important;
  padding: 28px !important;
}
.ce-doc-head { display: flex !important; justify-content: space-between !important; align-items: flex-start !important; margin-bottom: 20px !important; }
.ce-doc-head h3 { margin: 0 !important; font-size: 22px !important; font-weight: 800 !important; letter-spacing: -.4px !important; color: var(--v2-text) !important; }
.ce-doc-head span { font-size: 12px !important; color: var(--v2-text-3) !important; }
.ce-doc-draft {
  font-size: 11px !important; font-weight: 700 !important; letter-spacing: .06em !important; text-transform: uppercase !important;
  color: var(--v2-amber-fg) !important; background: var(--v2-amber-s) !important;
  border-radius: 99px !important; padding: 4px 12px !important;
}
.ce-doc-parties { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 16px !important; margin-bottom: 16px !important; }
.ce-doc-parties small { display: block !important; font-size: 11px !important; color: var(--v2-text-3) !important; margin-bottom: 2px !important; }
.ce-doc-parties strong { font-size: 13px !important; color: var(--v2-text) !important; }
.ce-doc-meta { font-size: 12px !important; color: var(--v2-text-2) !important; margin-bottom: 16px !important; }
.ce-doc-meta b { color: var(--v2-text) !important; }
.ce-doc-table { width: 100% !important; border-collapse: collapse !important; font-size: 13px !important; margin-bottom: 16px !important; }
.ce-doc-table th { text-align: left !important; font-size: 10.5px !important; text-transform: uppercase !important; letter-spacing: .06em !important; color: var(--v2-text-3) !important; padding: 0 0 8px !important; border-bottom: 1px solid var(--v2-border) !important; }
.ce-doc-table td { padding: 9px 0 !important; border-bottom: 1px solid var(--v2-border-2) !important; color: var(--v2-text) !important; vertical-align: top !important; }
/* t_4394c837: uten venstre-polstring hadde nabokolonner (Antall/Pris/Sum) ingen luft mellom seg -
   med border-collapse: collapse og 0 horisontal polstring rant høyrejustert tekst i to tilstøtende
   tallkolonner sammen til en uleselig streng (f.eks. "1" + "1 500,00" ble visuelt "11 500,00") så
   snart beløpet fikk nok sifre til at kolonnebredden økte inntil null-mellomrommet. Fast venstre-
   polstring gir en konstant visuell luke uavhengig av kolonnenes auto-bredde. */
.ce-doc-table .n { text-align: right !important; white-space: nowrap !important; font-variant-numeric: tabular-nums !important; padding-left: 16px !important; }
.ce-doc-table th.n { text-align: right !important; padding-left: 16px !important; }
.ce-doc-group td { font-weight: 700 !important; font-size: 12px !important; background: var(--v2-surface-2) !important; }
.ce-doc-empty { text-align: center !important; color: var(--v2-text-3) !important; padding: 20px 0 !important; }
.ce-doc-totals { display: flex !important; flex-direction: column !important; gap: 6px !important; margin-bottom: 16px !important; }
.ce-doc-totals > div { display: flex !important; justify-content: space-between !important; font-size: 13px !important; color: var(--v2-text-2) !important; }
.ce-doc-totals strong { color: var(--v2-text) !important; font-variant-numeric: tabular-nums !important; }
.ce-doc-totals .grand { background: var(--v2-blue-s) !important; border-radius: 9px !important; padding: 10px 14px !important; margin-top: 4px !important; }
.ce-doc-totals .grand span, .ce-doc-totals .grand strong { color: var(--v2-blue-fg) !important; font-weight: 700 !important; }
.ce-doc-note small { font-size: 11px !important; color: var(--v2-text-3) !important; }
.ce-doc-note p { margin: 2px 0 0 !important; font-size: 13px !important; color: var(--v2-text-2) !important; }

/* ── Flat seksjon (tittel + skillelinje, ingen boks) ── */
/* Batch 8: avgrenset til dokumentskjemaet. Uten avgrensning overstyrte regelen polstringen i ce-ui.css sin .ce-section
   (kortflaten), så rapportoversikten fikk innhold kant i kant med rammen – og skjemaet fikk ramme rundt hver seksjon. */
.ce-doc-editor .ce-section, #invoice-import-preview-card.ce-section { padding: 4px 0 28px !important; background: none !important; border: 0 !important; border-radius: 0 !important; gap: 0; }
.ce-doc-editor .ce-section + .ce-section { border-top: 1px solid var(--v2-border) !important; padding-top: 24px !important; }
.ce-section-h {
  display: flex !important; align-items: flex-start !important; justify-content: space-between !important;
  gap: 16px !important; margin-bottom: 18px !important;
}
.ce-section-h h2 { margin: 0 !important; font-size: 17px !important; font-weight: 700 !important; color: var(--v2-text) !important; letter-spacing: -.2px !important; }
.ce-section-h h3 { margin: 0 !important; font-size: 14px !important; font-weight: 700 !important; color: var(--v2-text) !important; }
.ce-section-h p { margin: 4px 0 0 !important; font-size: 13px !important; color: var(--v2-text-2) !important; }
.ce-section-f {
  display: flex !important; align-items: center !important; gap: 10px !important;
  padding-top: 18px !important; margin-top: 8px !important;
  border-top: 1px solid var(--v2-border) !important;
  font-size: 13px !important; color: var(--v2-text-2) !important;
}

/* ── Flat radio-rad ── */
.ce-radio-flat {
  display: flex !important; align-items: center !important; gap: 10px !important;
  padding: 10px 2px !important;
  font-size: 13px !important; font-weight: 500 !important; color: var(--v2-text) !important;
  cursor: pointer !important; border-bottom: 1px solid var(--v2-border-2) !important;
}
.ce-radio-flat:last-of-type { border-bottom: 0 !important; }
.ce-radio-flat input { accent-color: var(--v2-blue) !important; width: 16px !important; height: 16px !important; }
.ce-radio-flat:has(input:checked) span { color: var(--v2-blue-fg) !important; font-weight: 600 !important; }

/* ── Skjema ── */
.ce-form-grid {
  display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 16px !important;
}
@media (max-width: 640px) { .ce-form-grid { grid-template-columns: 1fr !important; } }
.ce-field { display: flex !important; flex-direction: column !important; gap: 6px !important; min-width: 0 !important; }
.ce-field > label {
  font-size: 11px !important; font-weight: 700 !important;
  letter-spacing: .07em !important; text-transform: uppercase !important;
  color: var(--v2-text-2) !important;
}
.ce-field input, .ce-field select {
  height: 42px !important; border: 1px solid var(--v2-border) !important;
  border-radius: 9px !important; background: var(--v2-surface) !important;
  padding: 0 12px !important; font-size: 14px !important; color: var(--v2-text) !important;
  font-family: inherit !important; width: 100% !important;
}
.ce-field input:focus, .ce-field select:focus {
  border-color: var(--v2-blue) !important; outline: none !important;
  box-shadow: 0 0 0 3px rgba(43,94,246,.12) !important;
}

/* ── Kundevelger som fullbredde felt ── */
.invoice-customer-picker { width: 100% !important; }
body .invoice-customer-trigger {
  width: 100% !important; min-height: 42px !important;
  justify-content: space-between !important;
  font-size: 14px !important; border-radius: 9px !important;
}
body .invoice-customer-trigger:hover { border-color: var(--v2-blue) !important; }
body .invoice-customer-trigger i { color: var(--v2-text-3) !important; font-style: normal !important; }

/* ── Fakturanummer som segmentert kontroll ── */
body .invoice-number-input { gap: 0 !important; }
body .invoice-number-auto {
  min-height: 42px !important; border: 1px solid var(--v2-border) !important; border-right: 0 !important;
  border-radius: 9px 0 0 9px !important; padding: 0 14px !important;
  display: inline-flex !important; align-items: center !important;
}
body .invoice-number-input .btn {
  min-height: 42px !important; border-radius: 0 9px 9px 0 !important; margin-left: 0 !important;
}
body .invoice-number-input .invoice-number-manual {
  min-height: 42px !important; border-radius: 0 !important;
  border-left: 0 !important; border-right: 0 !important;
}

/* Den gamle `.ce-field span`-regelen uppercaser ALT av spenn — skru av
   for innholdsspann (velger, feil, hint). Ekte labels styres av `> label`. */
body .ce-field .invoice-customer-trigger-label,
body .ce-field .invoice-product-trigger-label,
body .ce-field .ce-form-error,
body .ce-field .form-hint {
  text-transform: none !important;
  letter-spacing: normal !important;
  font-weight: 500 !important;
}
body .ce-field .invoice-customer-trigger-label { font-size: 14px !important; color: var(--v2-text) !important; font-weight: 400 !important; }

/* ── Diskret feilmelding under felt ── */
.ce-form-error {
  display: block !important; font-size: 12px !important;
  color: var(--v2-red-fg) !important; margin-top: 6px !important; line-height: 1.5 !important;
  text-transform: none !important; letter-spacing: normal !important;
}

/* Fakturavisning: historikk */
.invoice-audit-list { list-style: none; margin: 0; padding: 0; }
.invoice-audit-list li { padding: 6px 0; border-bottom: 1px solid var(--v2-border); }
.invoice-audit-list li:last-child { border-bottom: 0; }
.invoice-payments-total td { border-top: 2px solid var(--v2-border); }

/* ── Tilbud og ordre ── */
body .ce-qo-row { width: 100% !important; background: none !important; border-left: 0 !important; border-right: 0 !important; border-top: 0 !important; text-align: left !important; cursor: pointer !important; font: inherit !important; }
.ce-qo-pagination { display: flex !important; justify-content: flex-end !important; align-items: center !important; gap: 8px !important; padding: 12px 20px !important; }
.ce-qo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ce-qo-actions .ce-qo-danger { color: var(--v2-red-fg); border-color: var(--v2-red-s); }
.ce-qo-links { margin: 0 0 12px; font-size: 13px; color: var(--v2-text-2); }
.ce-qo-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin: 0 0 16px; }
.ce-qo-meta dt { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--v2-text-3); }
.ce-qo-meta dd { margin: 2px 0 0; font-size: 14px; color: var(--v2-text); }
.ce-qo-group-row td { background: var(--v2-surface-2); }
.ce-qo-totals { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 4px 24px; margin: 12px 0 16px; font-size: 14px; }
.ce-qo-totals dt { color: var(--v2-text-2); }
.ce-qo-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.ce-qo-totals .is-total { font-weight: 700; color: var(--v2-text); border-top: 1px solid var(--v2-border); padding-top: 4px; }
.ce-qo-note p { margin: 4px 0 0; white-space: pre-wrap; color: var(--v2-text-2); }
.ce-qo-head-fields { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.ce-qo-head-fields .ce-qo-span2 { grid-column: span 2; }
.ce-qo-lines-wrap { overflow-x: auto; }
.ce-qo-edit-lines { min-width: 720px; }
.ce-qo-edit-lines td { vertical-align: top; }
.ce-qo-edit-lines td:first-child { min-width: 240px; }
.ce-qo-edit-lines td:first-child .form-control + .form-control { margin-top: 6px; }
.ce-qo-edit-lines input[type=number] { min-width: 80px; }
.ce-qo-edit-lines [data-line-net] { white-space: nowrap; padding-top: 14px; font-variant-numeric: tabular-nums; }
.ce-qo-line-buttons { margin: 8px 0; }
@media (max-width: 700px) {
  .ce-qo-head-fields { grid-template-columns: 1fr 1fr; }
}
.ce-rec-subtitle { margin: 20px 0 8px; font-size: 14px; font-weight: 700; color: var(--v2-text); }

/* ── Viderefakturering ── */
.ce-bil-group { border-bottom: 1px solid var(--v2-border); }
.ce-bil-group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px 8px; }
.ce-bil-group-actions { display: flex; align-items: center; gap: 10px; }
.ce-bil-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--v2-border-2); }
.ce-bil-main { display: flex; gap: 12px; align-items: flex-start; margin: 0; cursor: pointer; min-width: 0; }
.ce-bil-main input { margin-top: 3px; }
.ce-bil-main span { display: flex; flex-direction: column; min-width: 0; }
.ce-bil-main strong { font-size: 13px; font-weight: 600; color: var(--v2-text); }
.ce-bil-main small, .ce-bil-amt small, .ce-bil-date { font-size: 12px; color: var(--v2-text-3); }
.ce-bil-amt { display: flex; flex-direction: column; align-items: flex-end; }
.ce-bil-amt strong { font-size: 14px; color: var(--v2-text); white-space: nowrap; }
.ce-bil-actions { white-space: nowrap; }
@media (max-width: 900px) {
  .ce-bil-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ce-bil-date, .ce-bil-status, .ce-bil-actions { grid-column: 1 / -1; }
}

/* ── Dokumentkategorier ── */
.ce-doccat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; padding: 16px 20px 20px; }
.ce-doccat-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--v2-border); border-radius: var(--v2-radius-sm); background: var(--v2-surface); color: inherit; text-decoration: none; }
.ce-doccat-card:hover { border-color: var(--v2-blue); background: var(--v2-surface-2); }
.ce-doccat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ce-doccat-head strong { font-size: 14px; color: var(--v2-text); }
.ce-doccat-count { font-size: 20px; font-weight: 700; color: var(--v2-text); font-variant-numeric: tabular-nums; }

/* ── Rapportfaner: rapportroten skal ikke vokse etter fanelinjen ── */
.ce-reports-root { grid-template-columns: minmax(0, 1fr) !important; }
.ce-reports-root > * { min-width: 0; }

/* ── Mobil (375 px): handlingsknapper brytes, faner scrolles ── */
@media (max-width: 700px) {
  .ce-purch-card-actions,
  .ce-purch-row-actions,
  .invoice-list-actions,
  .invoice-line-add-buttons { flex-wrap: wrap !important; flex-shrink: 1 !important; min-width: 0 !important; }
  .ce-purch-card-actions .btn,
  .invoice-list-actions .btn { max-width: 100% !important; white-space: normal !important; height: auto !important; min-height: 30px; }
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .dash-kpi-card { min-width: 0 !important; }
  .ce-enterprise-tabs { overflow-x: auto !important; }
  .ce-enterprise-tab { flex-shrink: 0 !important; white-space: nowrap !important; }
}

/* ── Sammenleggbare kort i venstrekolonnen ── */
.ce-collapsed-section { display: none !important; }
.ce-side-toggle[aria-expanded="false"] > span:last-child,
.ce-list-filter-title[aria-expanded="false"] > span:last-child,
.invoice-filter-title[aria-expanded="false"] > span:last-child { transform: rotate(-90deg); }
.ce-side-toggle > span:last-child,
.ce-list-filter-title > span:last-child,
.invoice-filter-title > span:last-child { display: inline-block; transition: transform .15s; }

/* ── Aktiv sorteringsknapp i verktøylinjen ── */
.ce-list-sort [data-crud-sort].active { color: var(--v2-blue-fg) !important; font-weight: 700 !important; }

/* ── Synlig tastaturfokus ── */
.ce-reports-tabs a:focus-visible,
.sales-tabs a:focus-visible,
.ce-list-sort .btn:focus-visible,
.ce-side-toggle:focus-visible,
.ce-list-filter-title:focus-visible,
.invoice-filter-title:focus-visible,
.status-bar-row:focus-visible { outline: 2px solid var(--ce-focus, var(--v2-blue)) !important; outline-offset: 2px !important; }
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--ce-focus, var(--v2-blue)); outline-offset: 2px; }

/* ── Seksjonsoverskrifter i undermenyen (layout.php gjør ['section' => …] om til en synlig etikett) ── */
body .cloud-sub-divider.cloud-sub-section {
  height: auto !important;
  background: none !important;
  margin: 10px 0 2px !important;
  padding: 6px 10px 2px !important;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #7F95AF; /* batch 11: 5,5:1 mot sidemenyen #0F1E31 */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Deaktiverte knapper skal se deaktivert ut (det fantes ingen regel; f.eks. «Send» på RF-1086 så aktiv ut) ── */
.btn:disabled, .btn[disabled], .btn.disabled, .btn[aria-disabled="true"] {
  opacity: .5 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}
.btn-primary:disabled:hover, .btn-primary[disabled]:hover { background: var(--v2-blue) !important; border-color: var(--v2-blue) !important; }
.btn-outline:disabled:hover, .btn-outline[disabled]:hover { background: var(--v2-surface) !important; color: var(--v2-text-2) !important; }
a.btn.disabled, a.btn[aria-disabled="true"] { pointer-events: none !important; }

/* ── EHF auto-behandling: sidepanelet (erstatter inline lyse farger som ble uleselige i mørkt tema) ── */
.ehf-auto-sep { margin: 8px 0; border: 0; border-top: 1px solid var(--v2-border); }
.ehf-auto-subhead { font-size: 12px; font-weight: 600; color: var(--v2-text-2); margin-bottom: 6px; }
.ehf-auto-status { font-size: 11px; color: var(--v2-text-3); text-align: center; }

/* ── Fakturalinje: MVA-sats og MVA-kode (for 0 %) i samme rutenettcelle ── */
.invoice-line-vatcell { display: grid; gap: 6px; min-width: 0; }
.invoice-line-vatcell select { width: 100%; min-width: 0; }
.invoice-line-vatcell select[hidden] { display: none !important; }

/* ════════════════════════════════════════════════════════════════════════
   Batch 19: portalskallet – søkepalett, «Venter på deg», utløpt økt, 404, utskrift (bare tokens)
   ════════════════════════════════════════════════════════════════════════ */
/* Søkeknappen i toppfeltet (var et tekstfelt uten søk bak). Ser ut som før, men er en knapp som åpner paletten. */
body .topbar button.ce-search-trigger { cursor: pointer; font: inherit; text-align: left; color: var(--v2-text-2) !important; }
body .topbar button.ce-search-trigger:hover { border-color: var(--v2-blue) !important; }
body .topbar button.ce-search-trigger:focus-visible { outline: 2px solid var(--ce-focus, var(--v2-blue)); outline-offset: 2px; border-color: var(--ce-focus, var(--v2-blue)) !important; }
.ce-search-trigger-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
body .topbar .ce-search-mobile { display: none !important; }
@media (max-width: 720px) { body .topbar .ce-search-mobile { display: grid !important; } }
.topbar-icon-btn:focus-visible, .topbar-toggle:focus-visible { outline: 2px solid var(--ce-focus, var(--v2-blue)) !important; outline-offset: 2px; }

/* Paletten */
.ce-cmdk { position: fixed; inset: 0; z-index: 10040; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.ce-cmdk[hidden] { display: none; }
.ce-cmdk-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.ce-cmdk-dialog { position: relative; width: min(640px, 100%); max-height: min(560px, 76vh); display: flex; flex-direction: column; background: var(--v2-surface); color: var(--v2-text); border: 1px solid var(--v2-border); border-radius: 12px; box-shadow: 0 24px 48px rgba(15, 23, 42, .28); overflow: hidden; }
.ce-cmdk-head { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--v2-border); color: var(--v2-text-3); }
.ce-cmdk-head svg { flex-shrink: 0; }
body .ce-cmdk-head input { flex: 1 1 auto; min-width: 0; height: 54px; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none !important; padding: 0 !important; font-size: 16px; color: var(--v2-text); }
.ce-cmdk-head input::placeholder { color: var(--v2-text-3); opacity: 1; }
/* Feltet er hele toppen av dialogen; den globale fokusrammen rundt felt ble en boks i boksen. Markøren viser fokus. */
body .ce-cmdk-head input:focus, body .ce-cmdk-head input:focus-visible { outline: none !important; box-shadow: none !important; border: 0 !important; }
@media (min-width: 1200px) { body .topbar .ce-search-trigger { flex-basis: 270px !important; } }
.ce-cmdk-close { flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--v2-text-2); background: var(--v2-surface-2); border: 1px solid var(--v2-border); border-radius: 6px; padding: 3px 7px; cursor: pointer; }
.ce-cmdk-body { overflow-y: auto; overscroll-behavior: contain; padding: 6px 0 8px; }
.ce-cmdk-group + .ce-cmdk-group { margin-top: 4px; }
.ce-cmdk-gtitle { padding: 10px 16px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--v2-text-2); }
.ce-cmdk-opt { display: flex; align-items: center; gap: 12px; margin: 0 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.ce-cmdk-opt.is-active { background: var(--v2-blue-s); box-shadow: inset 3px 0 0 var(--v2-blue); }
.ce-cmdk-kind { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; background: var(--v2-surface-2); border: 1px solid var(--v2-border); font-size: 12px; font-weight: 700; color: var(--v2-text-2); }
.ce-cmdk-opt.is-active .ce-cmdk-kind { color: var(--v2-blue-fg); border-color: var(--v2-blue); }
.ce-cmdk-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ce-cmdk-label { font-size: 14px; font-weight: 600; color: var(--v2-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-cmdk-sub { font-size: 12px; color: var(--v2-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-cmdk-type { flex-shrink: 0; font-size: 11px; color: var(--v2-text-2); }
.ce-cmdk-skel { display: grid; gap: 8px; padding: 6px 18px 8px; }
.ce-cmdk-gerror { margin: 2px 16px 4px; font-size: 13px; color: var(--v2-red-fg); }
.ce-cmdk-empty { display: grid; gap: 4px; padding: 18px 16px 10px; text-align: center; font-size: 13px; color: var(--v2-text-2); }
.ce-cmdk-empty strong { color: var(--v2-text); font-size: 14px; }
.ce-cmdk-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 16px; border-top: 1px solid var(--v2-border); background: var(--v2-surface-2); font-size: 12px; color: var(--v2-text-2); }
.ce-cmdk-foot kbd { display: inline-block; min-width: 18px; margin-right: 3px; padding: 0 5px; font: 600 11px/1.6 var(--ce-font-sans); text-align: center; color: var(--v2-text-2); background: var(--v2-surface); border: 1px solid var(--v2-border); border-bottom-width: 2px; border-radius: 4px; }
@media (max-width: 560px) {
  .ce-cmdk { padding: 8px; }
  .ce-cmdk-dialog { max-height: calc(100dvh - 16px); }
  .ce-cmdk-foot { display: none; }
  .ce-cmdk-type { display: none; }
}

/* «Venter på deg» (bjella) */
#notif-toggle { position: relative; }
.ce-notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--v2-red); box-shadow: 0 0 0 2px var(--v2-surface); }
.ce-notif-dot[hidden] { display: none; }
body .notif-panel { width: min(340px, calc(100vw - 24px)); }
.notif-list { list-style: none; margin: 0; padding: 4px 0; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 14px; color: var(--v2-text) !important; text-decoration: none !important; }
.notif-item:hover, .notif-item:focus-visible { background: var(--v2-surface-2); }
.notif-item:focus-visible { outline: 2px solid var(--ce-focus, var(--v2-blue)); outline-offset: -2px; }
.notif-count { flex: 0 0 auto; min-width: 34px; padding: 1px 7px; border-radius: 999px; background: var(--v2-blue-s); color: var(--v2-blue-fg); font-size: 12px; font-weight: 700; text-align: center; }
.notif-text { display: flex; flex-direction: column; min-width: 0; }
.notif-label { font-size: 13px; font-weight: 600; line-height: 1.35; }
.notif-meta { font-size: 12px; color: var(--v2-text-2); }
body .notif-empty { display: grid; gap: 4px; text-align: left !important; color: var(--v2-text-2) !important; }
.notif-empty strong { color: var(--v2-text); }
.notif-skel { display: grid; gap: 10px; padding: 14px; }
.notif-error { display: grid; gap: 8px; justify-items: start; padding: 12px 14px; font-size: 13px; color: var(--v2-red-fg); }
.notif-foot { display: block; padding: 9px 14px; border-top: 1px solid var(--v2-border); font-size: 13px; font-weight: 600; color: var(--v2-blue-fg) !important; }
/* Batch 20: «Hendelser» i bjella (EHF, Altinn, ikke sendt), «Merk alle som sett», ny-markering */
body .notif-panel { width: min(360px, calc(100vw - 24px)); }
body .notif-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding-top: 6px !important; padding-bottom: 6px !important; }
.notif-seen-btn { padding: 3px 8px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--v2-blue-fg); cursor: pointer; }
.notif-seen-btn:hover { background: var(--v2-blue-s); }
.notif-seen-btn:focus-visible { outline: 2px solid var(--ce-focus, var(--v2-blue)); outline-offset: 1px; }
.notif-seen-btn[hidden] { display: none; }
.notif-body { max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; }
.notif-sec + .notif-sec { border-top: 1px solid var(--v2-border); }
.notif-sec-title { margin: 0; padding: 10px 14px 2px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--v2-text-2); }
.notif-ev { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 9px 30px 9px 14px; color: var(--v2-text) !important; text-decoration: none !important; }
.notif-ev:hover, .notif-ev:focus-visible { background: var(--v2-surface-2); }
.notif-ev:focus-visible { outline: 2px solid var(--ce-focus, var(--v2-blue)); outline-offset: -2px; }
.notif-ev-icon { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--v2-blue-s); color: var(--v2-blue-fg); }
.notif-ev--altinn .notif-ev-icon { background: var(--v2-teal-s); color: var(--v2-teal-fg); }
.notif-ev--failed .notif-ev-icon { background: var(--v2-red-s); color: var(--v2-red-fg); }
.notif-ev .notif-label { font-weight: 500; overflow-wrap: anywhere; }
.notif-ev.is-new .notif-label { font-weight: 700; }
.notif-ev .notif-meta { overflow-wrap: anywhere; }
.notif-time { font-size: 12px; color: var(--v2-text-2); }
.notif-type { font-weight: 600; }
.notif-new { position: absolute; top: 14px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--v2-red); }
.notif-error--inline { padding-top: 6px; padding-bottom: 6px; }

/* Utløpt økt og manglende tilgang */
.ce-session-notice { position: fixed; z-index: 10100; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: 10px; border: 1px solid var(--v2-border); border-left: 4px solid var(--v2-amber); background: var(--v2-surface); color: var(--v2-text); box-shadow: var(--v2-shadow); font-size: 14px; line-height: 1.45; }
.ce-session-notice svg { flex: 0 0 auto; color: var(--v2-amber-fg); }
.ce-session-notice a { color: var(--v2-blue-fg); font-weight: 600; text-decoration: underline; }
.ce-shell-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 16px; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--v2-border); border-left: 4px solid var(--v2-amber); background: var(--v2-amber-s); color: var(--v2-text); font-size: 14px; }
.ce-shell-banner--access { border-left-color: var(--v2-red); background: var(--v2-red-s); }
.ce-shell-banner-detail { color: var(--v2-text-2); font-size: 13px; }

/* 404 i skallet */
.ce-notfound { max-width: 620px; margin: 24px auto; padding: 32px 28px !important; text-align: center; }
.ce-notfound-code { font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--v2-text-3); }
.ce-notfound h2 { margin: 12px 0 8px; font-size: 22px; color: var(--v2-text); }
.ce-notfound code { word-break: break-all; font-size: 13px; padding: 1px 5px; border-radius: 4px; background: var(--v2-surface-2); color: var(--v2-text); }
.ce-notfound-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }

/* Innlogging: melding når økten utløp (login.php ?reason=expired) */
.login-notice { margin-bottom: 20px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--l-border); border-left: 4px solid var(--l-blue); background: var(--l-bg); color: var(--l-text); font-size: 13px; line-height: 1.5; }

/* Utskrift: bare innholdet. Sidemeny, toppfelt, knapper, filtre og toaster skjules; layout-shell.js bytter til lyst tema. */
.ce-print-meta { display: none; }
@media print {
  @page { margin: 14mm 12mm; }
  html, body, body .main, body .page-wrapper { background: var(--v2-surface) !important; }
  body .skip-link, body #sidebar, body .sidebar-backdrop, body .topbar, body .footer, body #ce-toast-container, body .ce-cmdk,
  body .ce-session-notice, body .ce-shell-banner, body .ce-sb-tip, body .page-actions, body .phb-actions, body .ce-setup-tabs,
  body .page-wrapper button, body .page-wrapper .btn, body .page-wrapper select, body .ce-reports-filter, body .ce-reports-tabs,
  body .invoice-line-actions, body .ce-report-pagination, body [data-print-hide], body .ce-row-menu, body .ce-inv-menu,
  body .ce-filter-bar, body .ce-report-toolbar, body .ce-report-toolbar__hint, body :is(.card, .ce-panel, .panel):has(> .ce-filter-bar:only-child) { display: none !important; }
  body .main { margin: 0 !important; padding: 0 !important; left: 0 !important; width: auto !important; min-height: 0 !important; }
  body .page-wrapper { padding: 0 !important; max-width: none !important; }
  .ce-print-meta { display: block; margin: 0 0 6mm; padding-bottom: 2mm; border-bottom: 1px solid var(--v2-border); font-size: 10pt; color: var(--v2-text-2); }
  body .page-heading-bar { margin: 0 0 4mm !important; padding: 0 !important; }
  body .card, body .ce-panel, body .panel, body .ce-section { box-shadow: none !important; }
  /* Små kort holdes samlet; store (rapporttabellen) får brytes, ellers blir det tomme sider. */
  body .invoice-widget-card, body .ce-report-metric, body .ce-kpi, body figure, body canvas { break-inside: avoid; }
  body canvas { max-width: 100% !important; height: auto !important; }
  body .ce-table-wrap, body .table-responsive, body .ce-reports-content { overflow: visible !important; max-height: none !important; }
  body table { width: 100% !important; min-width: 0 !important; }
  body .page-wrapper .panel, body .page-wrapper .card, body .page-wrapper .ce-panel { overflow: visible !important; }
  body thead { display: table-header-group; }
  body .page-wrapper td, body .page-wrapper th { padding: 4px 6px !important; font-size: 9pt !important; line-height: 1.3 !important; }
  body tr, body .ce-list-row { break-inside: avoid; }
  body a[href] { color: inherit !important; text-decoration: none !important; }
  body * { animation: none !important; transition: none !important; }
}
