/* ==========================================================================
   Byggkart – visuelt tema (lastes sist). Myke flater, kort med luft, flytende paneler.
   ========================================================================== */
:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6eaf0;
  --line-2: #eef1f5;
  --soft: #f6f8fb;
  /* Merkefarge – byttes med html[data-palette] (se paletter under) */
  /* Standard: Byggblå. Oransje er reservert for status «Pågår» og varsler. */
  --accent: #2563eb; --accent-hi: #3b82f6; --accent-2: #1d4ed8; --accent-3: #1e3a8a; --accent-rgb: 37, 99, 235;
  --accent-soft: #eef4ff; --accent-line: #c7d7fe; --accent-line-2: #93b4fb; --glow: #dce8ff; --on-accent: #fff;
  --top: #0b1324;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .04);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .25), 0 2px 6px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .45), 0 4px 14px rgba(15, 23, 42, .08);
  --r: 12px;
  --r-lg: 18px;
}
/* Paletter */
html[data-palette="oransje"] { --accent: #f97316; --accent-hi: #fb923c; --accent-2: #ea580c; --accent-3: #c2410c; --accent-rgb: 249, 115, 22;
  --accent-soft: #fff4ec; --accent-line: #fed7aa; --accent-line-2: #fdba74; --glow: #fde7d6; }
html[data-palette="dempet"] { --accent: #d9480f; --accent-hi: #e8590c; --accent-2: #c2410c; --accent-3: #9a3412; --accent-rgb: 217, 72, 15;
  --accent-soft: #fdf1ea; --accent-line: #f6d3bf; --accent-line-2: #eeb08c; --glow: #f3e2d7; }
html[data-palette="bla"] { --accent: #2563eb; --accent-hi: #3b82f6; --accent-2: #1d4ed8; --accent-3: #1e3a8a; --accent-rgb: 37, 99, 235;
  --accent-soft: #eef4ff; --accent-line: #c7d7fe; --accent-line-2: #93b4fb; --glow: #dce8ff; }
html[data-palette="gul"] { --accent: #f2b200; --accent-hi: #fcc419; --accent-2: #d99a00; --accent-3: #a67500; --accent-rgb: 242, 178, 0;
  --accent-soft: #fff8e1; --accent-line: #fde68a; --accent-line-2: #fcd34d; --glow: #fff1c2; --on-accent: #1c1917; }
html, body { font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
/* Rester av fast oransje i eldre stilark */
.btn.primary { color: var(--on-accent); }
.logo, .tile-ico svg { color: var(--on-accent); }
.tile-ico svg { stroke: var(--on-accent); }
.mod.on, .user-menu button:hover, .search-results div:hover, .search-results div.sel { background: var(--accent-soft); }
.mod.on, .kpi.click.on { border-color: var(--accent); }
.kpi.click.on { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
.tabs button.active, .subtabs button.active { border-bottom-color: transparent; }
.spinner { border-top-color: var(--accent); }
.layer input, .mod input { accent-color: var(--accent); }
.app-title { color: var(--accent-line-2); }
.mk.addr { border-color: var(--accent); }
body { background: radial-gradient(1200px 600px at 10% -10%, var(--glow) 0%, transparent 60%), radial-gradient(1000px 700px at 110% 10%, #dbe7ff 0%, transparent 55%), var(--bg); background-attachment: fixed; }
h1, h2 { letter-spacing: -.015em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: #94a3b8; }
a { color: var(--accent-2); }

/* ---------- Topplinje ---------- */
.topbar { height: 60px; background: rgba(11, 19, 36, .88); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .06); gap: 14px; padding: 0 18px; }
.brand { font-size: 16px; letter-spacing: -.01em; gap: 10px; }
.logo { width: 28px; height: 28px; border-radius: 9px; display: inline-grid; place-items: center; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-2)); box-shadow: 0 4px 12px -2px rgba(var(--accent-rgb), .6), inset 0 1px 0 rgba(255,255,255,.35); }
.search input { height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .08); padding: 0 14px; transition: background .15s; }
.search input::placeholder { color: #94a3b8; }
.search input:focus { background: #fff; border-color: transparent; box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .25); }
.search-results { top: 48px; border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.app-nav { background: rgba(255, 255, 255, .05); padding: 4px; border-radius: 12px; gap: 2px; }
.app-nav a { border-radius: 9px; padding: 6px 12px; color: #cbd5e1; font-weight: 500; }
.app-nav a.on { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.app-title { color: var(--accent-line-2); font-weight: 600; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.12); }
.tag { background: rgba(255,255,255,.1); border-radius: 99px; padding: 2px 8px; }

/* ---------- Knapper og felt ---------- */
.btn { border-radius: 10px; padding: 8px 14px; font-weight: 500; border-color: var(--line); box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:hover { border-color: #cbd5e1; background: var(--soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--accent-hi), var(--accent-2)); border-color: var(--accent-2); box-shadow: 0 6px 14px -6px rgba(var(--accent-rgb), .7), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.primary:hover { background: linear-gradient(180deg, var(--accent), var(--accent-3)); }
.btn.ghost { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .08); color: #e2e8f0; box-shadow: none; }
.btn.ghost:hover, .btn.ghost.on { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255,255,255,.14); }
.btn.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.danger { color: var(--bad); background: #fff; }
.btn.danger:hover { background: #fef2f2; border-color: #fecaca; }
.input, select.input, textarea.input { border-radius: 10px; border-color: var(--line); background: #fff; padding: 9px 12px; transition: border-color .15s, box-shadow .15s; }
.input:focus, textarea.input:focus { outline: none; border-color: var(--accent-line-2); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); }
.input.sm { border-radius: 8px; padding: 5px 8px; }
.seg { background: var(--soft); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0 !important; border-radius: 8px; background: transparent; padding: 6px 11px; color: var(--muted); font-weight: 500; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Chips ---------- */
.chip { font-weight: 600; padding: 3px 9px; letter-spacing: .01em; }
.chip.Pågår { background: #ffedd5; color: #c2410c; }
.chip.Planlagt { background: #e0e7ff; color: #4338ca; }
.chip.Ferdig { background: #dcfce7; color: #15803d; }
.chip.Pause { background: #f1f5f9; color: #475569; }
.chip.light { background: #f1f5f9; color: var(--ink-2); }

/* ---------- Kartvisning: flytende paneler ---------- */
#map { inset: 0; }
.panel { background: rgba(255, 255, 255, .97); box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.7); }
.panel.left { top: 72px; left: 12px; bottom: 12px; width: 372px; border-radius: var(--r-lg); overflow: hidden; }
.panel.right { top: 72px; right: 12px; bottom: 12px; width: 452px; border-radius: var(--r-lg); padding: 20px 20px 40px; }
.close { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 22px; color: var(--muted); }
.close:hover { background: var(--soft); color: var(--ink); }
.tabs { border: 0; margin: 12px 12px 0; padding: 4px; background: var(--soft); border-radius: 12px; gap: 2px; border: 1px solid var(--line); }
.tabs button { border: 0; border-radius: 9px; padding: 8px 4px; font-size: 12.5px; }
.tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); border: 0; }
.tab-body { padding: 14px 14px 20px; }
.subtabs { border: 0; margin: 14px 0; padding: 4px; gap: 2px; background: var(--soft); border-radius: 12px; border: 1px solid var(--line); scrollbar-width: none; }
.subtabs button { border: 0; border-radius: 9px; padding: 7px 10px; font-size: 12.5px; }
.subtabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); border: 0; }
.left-toggle { top: 72px; left: 12px; border-radius: 12px; }
.hint { top: 76px; padding: 9px 16px; box-shadow: var(--shadow-lg); background: rgba(15, 23, 42, .92); backdrop-filter: blur(8px); }
.legend { bottom: 18px; right: auto; left: 398px; border-radius: 12px; padding: 8px 12px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.maplibregl-ctrl-top-right { top: 64px; right: 4px; }
#app .maplibregl-ctrl-top-right { right: 476px; }
#app:has(#right.hidden) .maplibregl-ctrl-top-right { right: 4px; }
.maplibregl-ctrl-group { border-radius: 12px !important; box-shadow: var(--shadow) !important; overflow: hidden; }
.maplibregl-ctrl-group button { width: 34px; height: 34px; }
.maplibregl-popup-content { border-radius: 14px; box-shadow: var(--shadow-lg); padding: 12px 14px; }

/* ---------- Kort og lister ---------- */
.card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: var(--accent-line); background: #fff; box-shadow: 0 8px 20px -12px rgba(var(--accent-rgb), .45), var(--shadow-sm); transform: translateY(-1px); }
.card.active { border-color: var(--accent-line-2); background: linear-gradient(180deg, #fff, var(--accent-soft)); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15), var(--shadow-sm); }
.filters button { border-radius: 99px; padding: 4px 11px; font-weight: 500; background: #fff; box-shadow: var(--shadow-sm); }
.filters button.on { background: var(--ink); border-color: var(--ink); }
.bar { height: 6px; background: #eef1f5; margin-top: 8px; }
.addr-box { background: linear-gradient(135deg, var(--accent-soft), #fff); border-color: var(--accent-line); border-radius: 14px; padding: 12px 14px; }
.kpis { gap: 10px; }
.kpi { border: 1px solid var(--line); background: linear-gradient(180deg, #fff, var(--soft)); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.kpi .small { font-size: 11.5px; }
.kpi b { font-size: 22px; letter-spacing: -.02em; margin-top: 4px; }
.kpi.click:hover { border-color: var(--accent-line-2); }
.kpi.alert { background: linear-gradient(180deg, #fff, #fff5f5); }
dl.info { background: var(--soft); border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line-2); }
.check-row { padding: 11px 0; border-color: var(--line-2); }
.check-row .ico { border-radius: 9px; width: 28px; height: 28px; }
.layer { border-color: var(--line-2); }
.basemaps button, .tools button { border-radius: 12px; box-shadow: var(--shadow-sm); }
.basemaps button.on, .tools button.on { background: var(--accent-soft); border-color: var(--accent-line-2); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12); }
.result { border-radius: 14px; background: var(--soft); }
.gallery figure { border-radius: 12px; box-shadow: var(--shadow-sm); }
.entry { border-left: 3px solid var(--accent-line); }
.alert { border-radius: 12px; }
.fr { border-color: var(--line-2); }
table.t td, table.t th { border-color: var(--line-2); }

/* ---------- Modaler ---------- */
.modal { background: rgba(15, 23, 42, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-card { border-radius: 20px; box-shadow: var(--shadow-lg); }
#modal-body { border-radius: 20px; padding: 22px 24px; }
.modal-card .formgrid { gap: 12px; }
.formgrid label { font-weight: 500; color: var(--ink-2); }

/* ---------- Portal og app-sider ---------- */
.page { background: transparent; }
.page-main { padding-top: 88px; }
.page-main h1 { font-size: 28px; font-weight: 800; letter-spacing: -.025em; }
.portal-head { margin-bottom: 24px; }
.portal-head h1 { font-size: 32px; }
.box, .varsler { border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.8); background: rgba(255,255,255,.92); }
.tiles { gap: 14px; }
.tile { border-radius: var(--r-lg); padding: 18px; background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.9); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s; }
a.tile:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: 0 22px 40px -18px rgba(var(--accent-rgb), .45), var(--shadow); }
.tile-ico { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, var(--accent-hi), var(--accent-2)); box-shadow: 0 8px 18px -8px rgba(var(--accent-rgb), .8), inset 0 1px 0 rgba(255,255,255,.3); }
.tile-ico svg { stroke: #fff; }
.tiles.locked .tile { background: rgba(255,255,255,.5); box-shadow: none; border: 1px dashed #cbd5e1; }
.tiles.locked .tile-ico { background: #e2e8f0; box-shadow: none; }
.tiles.locked .tile-ico svg { stroke: #94a3b8; }
.tile-kpis { gap: 6px; margin-top: 12px; }
.tile-kpis span { background: var(--soft); border: 1px solid var(--line-2); border-radius: 99px; padding: 3px 10px; }
.tile-kpis .hot { background: #fef2f2; border-color: #fee2e2; }
.varsel { border-radius: 12px; border: 0; padding: 10px; margin-bottom: 2px; }
.varsel:hover { background: var(--soft); }
.tbl th { border-color: var(--line); background: transparent; }
.tbl td { border-color: var(--line-2); }
.tbl tr.click:hover td { background: var(--accent-soft); }
.cam { border-radius: 14px; box-shadow: var(--shadow); }
.viewer { border-radius: 14px; }
.crew .p { border-radius: 12px; box-shadow: var(--shadow-sm); }
.cal .m { border-radius: 12px; box-shadow: var(--shadow-sm); }
.mod { border-radius: 14px; }
pre.code { border-radius: 12px; }

/* Bemanningsplan */
.pb { border-radius: 14px; border-color: var(--line); }
.pb-bar { border-radius: 7px; box-shadow: 0 2px 6px -2px rgba(0,0,0,.3); }
.pb-head, .pb-head .pb-name { background: var(--soft); }

/* Innlogging og superadmin */
.login { background: radial-gradient(900px 500px at 20% 10%, rgba(var(--accent-rgb),.35), transparent 60%), radial-gradient(800px 600px at 90% 90%, rgba(59,130,246,.25), transparent 60%), #0b1324; }
.login-card { border-radius: 22px; padding: 32px; box-shadow: var(--shadow-lg); }
.admin { background: transparent; }
.sa-main { padding-top: 84px; }
.sa-list, .sa-detail { border-radius: var(--r-lg); box-shadow: var(--shadow); }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .panel.left { top: 60px; left: 0; bottom: 0; border-radius: 0 var(--r-lg) var(--r-lg) 0; }
  .panel.right { top: 40%; right: 0; bottom: 0; left: 0; width: auto; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  #app .maplibregl-ctrl-top-right { right: 4px; }
  .legend { left: 12px; }
  .panel.left .tabs { margin-left: 56px; }
}


/* ---------- Prosjektkort i kartlisten ---------- */
.pcard { display: flex; gap: 12px; padding: 10px; position: relative; overflow: hidden; }
.pcard::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--st); opacity: .9; }
.pc-thumb { width: 64px; height: 64px; flex: none; border-radius: 12px; overflow: hidden; display: grid; place-items: center; font-size: 26px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--st) 22%, #fff), color-mix(in srgb, var(--st) 8%, #fff)); box-shadow: inset 0 0 0 1px rgba(15,23,42,.06); }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-body { flex: 1; min-width: 0; }
.pcard .title { font-size: 14px; line-height: 1.25; }
.pc-meta { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-prog { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pc-prog .bar { flex: 1; margin: 0; }
.pc-prog b { font-size: 12px; min-width: 34px; text-align: right; }
.pc-foot { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.pc-foot .chip { font-size: 10.5px; padding: 2px 8px; }
.bar > span { background: linear-gradient(90deg, color-mix(in srgb, var(--st, var(--accent)) 70%, #fff), var(--st, var(--accent))); }
.card .bar > span, .kpi .bar > span { background: linear-gradient(90deg, color-mix(in srgb, var(--st, var(--accent)) 65%, #fff), var(--st, var(--accent))); }
.bar > i { width: 2px; background: var(--ink); opacity: .55; border-radius: 2px; }
.pcard { --st: var(--accent); }
.kpi .bar { margin-top: 8px; height: 5px; }

/* ---------- Prosjektpanel: forsidebilde ---------- */
.phero { position: relative; margin: -20px -20px 0; height: 168px; border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden;
  background: radial-gradient(400px 200px at 85% -20%, rgba(255,255,255,.35), transparent 60%), linear-gradient(135deg, color-mix(in srgb, var(--st) 85%, #0b1324), color-mix(in srgb, var(--st) 45%, #0b1324)); }
.phero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform .6s; }
.phero.has-img:hover img { transform: scale(1.04); }
.phero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,19,36,.05) 20%, rgba(11,19,36,.82)); }
.phero-txt { position: absolute; left: 20px; right: 20px; bottom: 14px; color: #fff; }
.phero-txt h2 { color: #fff; font-size: 21px; margin: 6px 0 2px; padding: 0; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.phero-txt .small { color: rgba(255,255,255,.85); }
.phero-txt .chip { background: rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
#right-close { z-index: 3; top: 12px; right: 12px; background: rgba(255,255,255,.9); color: var(--ink); box-shadow: var(--shadow); backdrop-filter: blur(6px); }
#right-close:hover { background: #fff; }
#right .subtabs { margin-top: 14px; }

/* Fargevelger */
.palettes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.pal { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; text-align: left; align-items: center;
  border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 12px; box-shadow: var(--shadow-sm); }
.pal .sw { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 14px -6px rgba(0,0,0,.4); }
.pal.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .2); }

/* ---------- Mannskap ---------- */
.ms-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.ms-head p { margin: 2px 0 0; }
.ms-stats { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.ms-stat { background: rgba(255,255,255,.92); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.9); display: flex; flex-direction: column; gap: 2px; }
.ms-stat b { font-size: 28px; letter-spacing: -.03em; line-height: 1.1; }
.ms-stat span { color: var(--muted); font-size: 12.5px; }
.ms-stat.warn b { color: #b45309; }
.ms-stat.hero { background: linear-gradient(135deg, var(--accent-2), var(--accent-3)); color: #fff; border: 0; position: relative; overflow: hidden; }
.ms-stat.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.1); }
.ms-stat.hero b { font-size: 40px; }
.ms-stat.hero span { color: rgba(255,255,255,.85); }
.ms-stat.hero .badge-live { color: #bbf7d0; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.ms-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.ms-h { font-size: 15px; margin-bottom: 10px; }
.site { background: rgba(255,255,255,.95); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; border: 1px solid rgba(255,255,255,.9); }
.site-head { position: relative; height: 104px; display: flex; align-items: flex-end; justify-content: space-between; padding: 14px 18px; color: #fff;
  background: var(--img, linear-gradient(135deg, var(--accent-2), var(--accent-3))) center / cover; }
.site-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,19,36,.05), rgba(11,19,36,.8)); }
.site-title, .site-count { position: relative; }
.site-title a { color: #fff; font-weight: 700; font-size: 17px; text-decoration: none; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.site-title a:hover { text-decoration: underline; }
.site-title .small { color: rgba(255,255,255,.85); }
.site-count { text-align: right; background: rgba(255,255,255,.16); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.25); border-radius: 12px; padding: 6px 12px; }
.site-count b { display: block; font-size: 22px; line-height: 1; }
.site-count span { font-size: 11px; opacity: .9; }
.site-body { padding: 14px 18px 8px; }
.avstack { display: flex; margin-bottom: 10px; }
.avstack .av { margin-right: -8px; border: 2px solid #fff; }
.av { width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 80%, #fff), var(--c)); box-shadow: 0 2px 6px -2px rgba(0,0,0,.35); }
.av.sm { width: 32px; height: 32px; font-size: 11px; }
.av.more { background: #e2e8f0; color: var(--ink-2); }
.crew2 .cp { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.cp-time { text-align: right; line-height: 1.2; }
.cp-time b { display: block; font-size: 13px; }
.cp-time span { font-size: 11px; color: var(--muted); }
.ue-tag { color: var(--c); font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 18px; font-size: 13px; }
.ms-more { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ms-more a { text-decoration: none; }
.people { position: sticky; top: 76px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
#mp-list { overflow: auto; margin: 0 -6px; padding: 0 6px; }
.pp { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; }
.pp + .pp { border-top: 1px solid var(--line-2); }
.pp.click { cursor: pointer; }
.pp.click:hover { background: var(--accent-soft); }
.pp-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pp-tags span { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.tag-ok { background: #dcfce7; color: #15803d; }
.tag-warn { background: #fef3c7; color: #92400e; }
.tag-id { background: #f1f5f9; color: var(--ink-2); font-family: ui-monospace, Consolas, monospace; font-weight: 500 !important; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
@media (max-width: 1000px) { .ms-stats { grid-template-columns: repeat(2, 1fr); } .ms-stat.hero { grid-column: span 2; } .ms-grid { grid-template-columns: 1fr; } .people { position: static; max-height: none; } }

/* ---------- Flåte: ikoner, skilt, frist-kort ---------- */
.ucell { display: flex; gap: 12px; align-items: flex-start; }
.kico { width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; font-size: 19px; flex: none; background: #eef2ff; box-shadow: inset 0 0 0 1px rgba(15,23,42,.05); }
.kico.big { width: 56px; height: 56px; border-radius: 16px; font-size: 28px; box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(15,23,42,.05); }
.kico.k-Maskin { background: #fef9c3; } .kico.k-Bil { background: #e0f2fe; } .kico.k-Lastebil { background: #ede9fe; } .kico.k-Henger { background: #f1f5f9; } .kico.k-Utstyr { background: #dcfce7; }
.plate { display: inline-flex; align-items: stretch; border: 1.5px solid #1e293b; border-radius: 5px; background: #fff; font: 700 11.5px/1 ui-monospace, Consolas, monospace; letter-spacing: .06em; color: #0f172a; overflow: hidden; height: 20px; }
.plate i { font-style: normal; background: #1d4ed8; color: #fff; font-size: 8px; padding: 0 4px; display: grid; place-items: end center; padding-bottom: 2px; letter-spacing: 0; }
.plate { padding-right: 6px; gap: 5px; align-items: center; }
.plate i { align-self: stretch; }
.spill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 99px; white-space: nowrap; }
.spill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.spill.ok { background: #dcfce7; color: #15803d; } .spill.snart { background: #fef3c7; color: #b45309; } .spill.forfalt { background: #fee2e2; color: #b91c1c; }
.tbl td { padding: 11px 10px; }
.tbl thead th { position: sticky; top: 0; background: rgba(255,255,255,.96); z-index: 1; }
.tbl tr.sel td { background: var(--accent-soft); }
.tbl tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.fd-hero { position: relative; margin: -16px -16px 0; padding: 18px 16px 16px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: linear-gradient(180deg, var(--soft), #fff); border-bottom: 1px solid var(--line-2); }
.fd-hero.forfalt { background: linear-gradient(180deg, #fff1f2, #fff); }
.fd-hero.snart { background: linear-gradient(180deg, #fffbeb, #fff); }
.fd-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 9px; font-size: 20px; }
.fd-x:hover { background: #fff; color: var(--ink); }
.fd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
.fd-stats div { background: var(--soft); border: 1px solid var(--line-2); border-radius: 12px; padding: 9px 11px; }
.fd-stats span { display: block; font-size: 11px; color: var(--muted); }
.fd-stats b { font-size: 16px; } .fd-stats b.sm { font-size: 13px; }
.fd-actions { gap: 6px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.sec-h h3 { margin: 0; }
.due { display: flex; gap: 12px; align-items: center; padding: 11px 12px 11px 14px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 8px; position: relative; background: #fff; box-shadow: var(--shadow-sm); }
.due::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #16a34a; }
.due.snart::before { background: #f59e0b; } .due.forfalt::before { background: var(--bad); }
.due.forfalt { background: linear-gradient(90deg, #fff5f5, #fff 60%); }
.due-n { text-align: center; min-width: 64px; line-height: 1.1; }
.due-n b { display: block; font-size: 22px; letter-spacing: -.02em; color: #15803d; }
.due.snart .due-n b { color: #b45309; } .due.forfalt .due-n b { color: #b91c1c; }
.due-n span { font-size: 10.5px; color: var(--muted); }
.due-act { display: flex; gap: 6px; margin-top: 8px; }
.tl { position: relative; padding-left: 4px; }
.tl-i { display: flex; gap: 10px; padding: 8px 0; position: relative; }
.tl-i:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 38px; bottom: -4px; width: 2px; background: var(--line); }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; font-size: 14px; flex: none; }
.cal .m h4 { color: var(--ink-2); }

/* ---------- Kartlag: brytere og forhåndsvisning ---------- */
.layer { align-items: center; padding: 10px 2px; }
.layer input[type=checkbox], label.layer input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 36px; height: 21px; border-radius: 99px; background: #cbd5e1; position: relative; flex: none; margin: 0; cursor: pointer; transition: background .2s; }
.layer input[type=checkbox]::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.layer input[type=checkbox]:checked { background: var(--accent); }
.layer input[type=checkbox]:checked::after { transform: translateX(15px); }
.layer input[type=checkbox]:disabled { opacity: .5; cursor: default; }
.layer input[type=range] { margin-top: 6px; height: 4px; }
.layer.soon { opacity: .6; }
.basemaps { gap: 8px; }
.basemaps button { padding: 0; overflow: hidden; display: flex; flex-direction: column; font-weight: 600; background: #fff; }
.basemaps button::before { content: ""; display: block; height: 54px; background: center / cover no-repeat; border-bottom: 1px solid var(--line-2); }
.basemaps button[data-b="topo"]::before { background-image: url("/api/kart/fliser/topo/13/4332/2211"); }
.basemaps button[data-b="gra"]::before { background-image: url("/api/kart/fliser/gra/13/4332/2211"); }
.basemaps button[data-b="nib"]::before { background-image: url("/api/kart/nib/13/4332/2211"); }
.basemaps button { line-height: 1; }
.basemaps button { padding-bottom: 7px; gap: 7px; }
.basemaps button.on { box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm); }

/* ---------- Byggeplass-sjekk ---------- */
#checks { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.check-row { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; box-shadow: var(--shadow-sm); gap: 12px; }
.check-row.lvl-bad { background: linear-gradient(90deg, #fff5f5, #fff 70%); border-color: #fecaca; }
.check-row.lvl-warn { background: linear-gradient(90deg, #fffbeb, #fff 70%); border-color: #fde68a; }
.check-row .ico { width: 32px; height: 32px; border-radius: 10px; font-size: 14px; }
.check-row .t { font-size: 13px; }
.check-row .v { margin-top: 2px; font-size: 13px; }
.check-row .src { margin-top: 4px; color: #94a3b8; }
.check-row a { display: inline-block; margin-top: 4px; font-weight: 600; text-decoration: none; }
.ck-sum { border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; color: #fff; box-shadow: var(--shadow); }
.ck-sum b { font-size: 15px; }
.ck-sum span { font-size: 12px; opacity: .9; }
.ck-sum.ok { background: linear-gradient(135deg, #16a34a, #15803d); }
.ck-sum.warn { background: linear-gradient(135deg, #f59e0b, #d97706); }
.ck-sum.bad { background: linear-gradient(135deg, #ef4444, #b91c1c); }

/* ---------- Skjema i dialoger ---------- */
#modal-body > h2:first-child { font-size: 20px; margin-bottom: 4px; }
.formgrid { gap: 14px 12px; margin-top: 14px; }
.formgrid label { font-size: 12px; font-weight: 600; color: var(--ink-2); gap: 6px; }
.formgrid > .full.row:last-child, .stack > button[type=submit]:last-child { margin-top: 6px; }
.formgrid > .full.row:last-child { border-top: 1px solid var(--line-2); padding-top: 16px; flex-direction: row-reverse; justify-content: flex-start; gap: 8px; }
.formgrid > .full.row:last-child .grow { flex: 1; }
.formgrid p.full { margin: 0; background: var(--soft); border-radius: 10px; padding: 8px 10px; }

/* ---------- Bemanningsplan ---------- */
.pb { background: #fff; box-shadow: var(--shadow-sm); }
.pb-row { border-color: var(--line-2); }
.pb-body .pb-row:hover .pb-track, .pb-body .pb-row:hover .pb-name { background-color: #f8fafc; }
.pb-name { padding: 8px 12px; border-color: var(--line-2); }
.pb-name b { font-size: 13px; }
.pb-week { border-color: var(--line-2); color: var(--ink-2); }
.pb-bar { height: 22px; border-radius: 8px; font-size: 11px; padding: 3px 8px; letter-spacing: .01em; }
.pb-today { width: 2px; background: var(--bad); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.pb-legend { gap: 6px 10px; }
.pb-legend span { background: var(--soft); border: 1px solid var(--line-2); border-radius: 99px; padding: 3px 10px; }
.pb-legend i { border-radius: 50%; width: 9px; height: 9px; }

/* ---------- Kamera: videovegg ---------- */
.ms-stats.cams { grid-template-columns: 1.3fr repeat(3, 1fr); }
.cam-sec { margin-bottom: 22px; }
.cam-sec h2 a { color: var(--ink); text-decoration: none; }
.cam-sec h2 a:hover { color: var(--accent); }
.cam-sec .cam-grid { margin-top: 10px; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.cam { border-radius: 16px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; border: 1px solid rgba(255,255,255,.6); }
.cam:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.cam .cap { padding: 26px 12px 10px; font-size: 13px; align-items: flex-end; }
.cam-live { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: #fff;
  background: rgba(15,23,42,.6); backdrop-filter: blur(6px); padding: 4px 9px; border-radius: 99px; }
.cam-live i { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; animation: pulse 1.4s infinite; }
@media (max-width: 1000px) { .ms-stats.cams { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Innlogging ---------- */
.login-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) 400px; gap: 56px; align-items: center; width: 100%; max-width: 1040px; }
.login-hero { color: #e2e8f0; }
.login-hero h1 { font-size: 44px; line-height: 1.08; letter-spacing: -.035em; color: #fff; margin: 28px 0 14px; }
.login-hero p { font-size: 16px; line-height: 1.55; color: #94a3b8; max-width: 480px; margin: 0 0 24px; }
.login-hero ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 460px; }
.login-hero li { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(6px); }
.login-hero li b { color: #fff; font-size: 14px; }
.login-hero li span { color: #94a3b8; font-size: 13px; }
.brand.big.light { color: #fff; font-size: 22px; }
.login-card { max-width: none; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; max-width: 400px; gap: 24px; } .login-hero h1 { font-size: 30px; margin-top: 16px; } .login-hero p, .login-hero ul { display: none; } }

/* ---------- Lisenser ---------- */
.vendor { background: rgba(255,255,255,.95); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.9); margin-bottom: 14px; overflow: hidden; }
.vendor > header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: linear-gradient(180deg, var(--soft), #fff); border-bottom: 1px solid var(--line-2); }
.vlogo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .02em; flex: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c)); box-shadow: 0 6px 14px -6px var(--c); }
.vlogo.big { width: 56px; height: 56px; border-radius: 16px; font-size: 17px; }
.vsum { text-align: right; line-height: 1.15; } .vsum b { font-size: 17px; display: block; } .vsum span { font-size: 11px; color: var(--muted); }
.lrow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(170px, 1.3fr) 130px 170px; gap: 18px; align-items: center; padding: 12px 18px; cursor: pointer; transition: background .15s; }
.lrow + .lrow { border-top: 1px solid var(--line-2); }
.lrow:hover { background: var(--accent-soft); }
.lseat .bar { margin-top: 6px; }
.lcost { text-align: right; line-height: 1.2; } .lcost b { display: block; } .lcost span { font-size: 11px; color: var(--muted); }
.lren { text-align: right; } .lren .small { margin-top: 3px; }
.sync { color: var(--accent-2); font-weight: 500; }
.intg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.intg { background: rgba(255,255,255,.95); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.9); padding: 16px 18px; }
.intg-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; font-size: 20px; flex: none; border: 1px solid var(--line-2); }
.intg details ol { padding-left: 18px; margin: 6px 0 0; line-height: 1.6; }
@media (max-width: 900px) { .lrow { grid-template-columns: 1fr 1fr; } .lcost, .lren { text-align: left; } }

/* Funnet i regnskapet */
.fcard { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line-2); }
.fcard .vsum { min-width: 170px; }
.fact { display: flex; gap: 6px; }
.fcard.ignorert { opacity: .55; }
.fother { margin-top: 14px; }
.fother summary { cursor: pointer; font-weight: 600; color: var(--ink-2); padding: 8px 0; }
@media (max-width: 800px) { .fcard { flex-wrap: wrap; } .fcard .vsum { text-align: left; } }

/* ================= Forside (portal) ================= */
.portal2 { padding-top: 84px; }
.welcome { position: relative; overflow: hidden; border-radius: 24px; padding: 34px 36px; color: #fff; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: center;
  background: radial-gradient(700px 300px at 85% -20%, rgba(255,255,255,.18), transparent 60%), radial-gradient(600px 400px at -10% 120%, rgba(56,189,248,.35), transparent 60%),
    linear-gradient(135deg, #0b1324 0%, #13234a 45%, var(--accent-2) 120%);
  box-shadow: 0 30px 60px -30px rgba(15,23,42,.7); margin-bottom: 18px; }
.welcome::after { content: ""; position: absolute; right: -80px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(255,255,255,.04); pointer-events: none; }
.hero-date { font-size: 13px; color: #93c5fd; text-transform: capitalize; letter-spacing: .02em; }
.welcome h1 { font-size: 38px; margin: 6px 0 6px; letter-spacing: -.03em; color: #fff; }
.welcome p { margin: 0 0 20px; color: #cbd5e1; font-size: 15px; }
.hero-act { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-btn.primary { background: #fff; color: var(--ink); border: 0; box-shadow: 0 10px 20px -10px rgba(0,0,0,.6); font-weight: 600; padding: 11px 18px; text-decoration: none; border-radius: 12px; }
.hero-btn.primary:hover { background: #f1f5f9; }
.hero-search { display: flex; flex: 1; min-width: 260px; max-width: 440px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 12px; overflow: hidden; backdrop-filter: blur(10px); }
.hero-search input { flex: 1; background: transparent; border: 0; color: #fff; padding: 11px 14px; outline: none; font: inherit; }
.hero-search input::placeholder { color: #94a3b8; }
.hero-search button { border: 0; background: rgba(255,255,255,.14); color: #fff; padding: 0 16px; font-size: 18px; }
.hero-search:focus-within { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.14); }
.hero-side { position: relative; z-index: 1; }
.wx { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 16px 18px; backdrop-filter: blur(10px); min-height: 120px; }
.wx-now { display: flex; align-items: center; gap: 12px; }
.wx-ico { font-size: 40px; line-height: 1; }
.wx-now b { font-size: 34px; display: block; line-height: 1; letter-spacing: -.03em; }
.wx-now span { font-size: 12.5px; color: #cbd5e1; }
.wx-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; }
.wx-days div { background: rgba(255,255,255,.07); border-radius: 10px; padding: 6px; text-align: center; font-size: 15px; display: flex; flex-direction: column; gap: 2px; }
.wx-days span { font-size: 11px; color: #94a3b8; text-transform: capitalize; }
.wx-days b { font-size: 13px; }
.wx-warn { margin-top: 10px; font-size: 12px; color: #fde68a; }
.wx-src { margin-top: 8px; font-size: 10.5px; color: #64748b; }
.wx .spinner { border-color: rgba(255,255,255,.2); border-top-color: #fff; }

.stats2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 26px; }
.st2 { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 18px; background: rgba(255,255,255,.95); box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  border: 1px solid rgba(255,255,255,.9); transition: transform .2s, box-shadow .2s; }
.st2:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.st2-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--c) 12%, #fff); }
.st2-ico svg { width: 24px; height: 24px; fill: none; stroke: var(--c); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.st2 b { display: block; font-size: 26px; letter-spacing: -.03em; line-height: 1.05; }
.st2 span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.st2 small { display: block; font-size: 11.5px; color: var(--muted); }
.st2.hot b { color: var(--bad); }

.portal-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 12px; }
.sec-title h2 { font-size: 17px; margin: 0; }
.sec-title a { text-decoration: none; font-weight: 600; }
.tiles2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 28px; }
.tile2 { position: relative; display: flex; flex-direction: column; padding: 18px; border-radius: 20px; text-decoration: none; color: var(--ink); overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 7%, #fff), #fff 55%); border: 1px solid color-mix(in srgb, var(--c) 14%, #fff); box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s; }
.tile2::before { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: color-mix(in srgb, var(--c) 10%, transparent); }
a.tile2:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 40%, #fff); box-shadow: 0 24px 40px -20px color-mix(in srgb, var(--c) 60%, transparent), var(--shadow); }
.t2-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; position: relative; }
.t2-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c));
  box-shadow: 0 10px 18px -10px var(--c), inset 0 1px 0 rgba(255,255,255,.3); }
.t2-ico svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.t2-go { font-size: 12px; font-weight: 600; color: var(--c); opacity: 0; transform: translateX(-4px); transition: all .2s; }
a.tile2:hover .t2-go { opacity: 1; transform: none; }
.tile2 > b { font-size: 16px; position: relative; }
.tile2 p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; flex: 1; }
.t2-kpis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.t2-kpis span { font-size: 12px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; }
.t2-kpis b { color: var(--ink); font-size: 14px; }
.t2-kpis .hot { background: #fef2f2; border-color: #fecaca; color: #b91c1c; } .t2-kpis .hot b { color: #b91c1c; }
.tiles2.locked .tile2 { box-shadow: none; border-style: dashed; background: rgba(255,255,255,.55); }
.tiles2.locked .t2-ico { background: #cbd5e1; box-shadow: none; }

.pcards2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 28px; }
.pc2 { text-align: left; padding: 0; border: 1px solid rgba(255,255,255,.9); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--shadow); cursor: pointer; transition: transform .2s, box-shadow .2s; font: inherit; color: inherit; }
.pc2:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pc2-img { height: 110px; background: linear-gradient(135deg, #cbd5e1, #e2e8f0) center / cover; position: relative; }
.pc2-img .chip { position: absolute; top: 10px; left: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.pc2-body { padding: 12px 14px 14px; }
.pc2-body b { font-size: 14px; }

.varsler2 { position: sticky; top: 76px; background: rgba(255,255,255,.95); border-radius: 20px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.9); padding: 18px; max-height: calc(100vh - 96px); display: flex; flex-direction: column; }
.varsler2 h2 { font-size: 16px; margin: 0; }
.v-count { background: var(--ink); color: #fff; border-radius: 99px; font-size: 12px; font-weight: 700; padding: 2px 10px; }
.v-seg { margin: 12px 0 8px; align-self: flex-start; }
.v-list { overflow: auto; margin: 0 -8px; padding: 0 8px; flex: 1; }
.varsler2 .varsel { align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; margin: 0; }
.varsler2 .varsel + .varsel { border-top: 1px solid var(--line-2); }
.v-ico { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, #fff); }
.v-ico svg { width: 18px; height: 18px; fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.v-t { font-weight: 500; font-size: 13px; line-height: 1.35; }
.v-niva { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #3b82f6; }
.v-niva.bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(220,38,38,.12); } .v-niva.warn { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245,158,11,.14); }
.v-ok { text-align: center; padding: 26px 10px; } .v-ok span { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #dcfce7; color: #16a34a; font-size: 22px; margin-bottom: 8px; } .v-ok b { display: block; }
.varsler2 .btn.wide { margin-top: 10px; }
@media (max-width: 1100px) { .portal-grid2 { grid-template-columns: 1fr; } .varsler2 { position: static; max-height: none; } }
@media (max-width: 800px) { .welcome { grid-template-columns: 1fr; padding: 24px 20px; } .welcome h1 { font-size: 28px; } .hero-search { min-width: 0; } }
@media (max-width: 800px) {
  .hero-act { flex-direction: column; align-items: stretch; }
  .hero-btn.primary { text-align: center; }
  .hero-search { max-width: none; width: 100%; flex: none; }
  .stats2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .st2 { padding: 12px; gap: 10px; } .st2-ico { width: 38px; height: 38px; } .st2 b { font-size: 21px; } .st2 small { display: none; }
  .wx-days { display: none; }
}
.hero-date { text-transform: none; } .hero-date::first-letter { text-transform: uppercase; }

/* ================= Prosjekter: liste og fullskjerm ================= */
.tabs { overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: 1 0 auto; padding: 8px 9px; }
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.plc { display: block; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border: 1px solid rgba(255,255,255,.9); transition: transform .2s, box-shadow .2s; }
.plc:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.plc-img { height: 140px; background: linear-gradient(135deg, #cbd5e1, #e2e8f0) center / cover; position: relative; display: flex; gap: 6px; align-items: flex-start; padding: 10px; }
.plc-img .chip { box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.plc-body { padding: 14px 16px 16px; } .plc-body > b { font-size: 15px; }
.plc-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 10px; }
.pv-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pv-back { text-decoration: none; font-weight: 600; } .pv-nav { display: flex; gap: 6px; }
.pv { background: rgba(255,255,255,.96); border-radius: 22px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.9); padding: 22px 26px 30px; }
.phero.full { margin: -22px -26px 0; height: 230px; border-radius: 22px 22px 0 0; }
.phero.full .phero-txt { left: 26px; bottom: 20px; } .phero.full .phero-txt h2 { font-size: 30px; }
.phero-act { position: absolute; right: 20px; bottom: 20px; display: flex; gap: 8px; }
.phero-act .btn { background: rgba(255,255,255,.92); }
.ptab-full .kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.ptab-full .gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ptab-full dl.info { grid-template-columns: 180px 1fr; max-width: 760px; }

/* ================= Dokumentsenter ================= */
.dc { display: grid; gap: 14px; }
.dc-wide { grid-template-columns: 280px minmax(0, 1fr); min-height: 420px; }
.dc-narrow { grid-template-columns: 1fr; }
.dc-side { background: var(--soft); border: 1px solid var(--line-2); border-radius: 14px; padding: 8px; align-self: start; }
.dc-narrow .dc-tree { max-height: 190px; overflow: auto; }
.dc-f { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; background: transparent; padding: 7px 10px; border-radius: 9px; font-size: 13px; text-align: left; color: var(--ink-2); gap: 8px; }
.dc-f span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dc-f em { font-style: normal; }
.dc-f i { font-style: normal; font-size: 11px; color: var(--muted); background: #fff; border-radius: 99px; padding: 0 7px; }
.dc-f:hover { background: #fff; } .dc-f.on { background: #fff; color: var(--accent-2); font-weight: 600; box-shadow: var(--shadow-sm); }
.dc-side-act { display: flex; gap: 6px; padding: 8px 4px 2px; border-top: 1px solid var(--line); margin-top: 6px; }
.dc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dc-up { cursor: pointer; }
.dc-drop { border: 2px dashed var(--line); border-radius: 14px; padding: 14px; text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 10px; transition: all .15s; }
.dc-drop.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.dc-doc { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; }
.dc-doc + .dc-doc { border-top: 1px solid var(--line-2); }
.dc-doc:hover { background: var(--soft); }
.dc-doc .grow { min-width: 0; } .dc-doc b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.dc-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 19px; flex: none; }
.dc-act { display: flex; gap: 4px; flex: none; } .dc-act a.btn { text-decoration: none; }
.doc-view { height: 75vh; margin-top: 10px; border-radius: 12px; overflow: hidden; background: #0f172a; }
.doc-view iframe { width: 100%; height: 100%; border: 0; background: #fff; } .doc-view img { width: 100%; height: 100%; object-fit: contain; }
.ifc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 12px; margin-top: 10px; }
.ifc-view { height: 68vh; border-radius: 14px; overflow: hidden; background: #eef2f7; position: relative; }
.ifc-load { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.ifc-side { background: var(--soft); border-radius: 14px; padding: 12px; overflow: auto; max-height: 68vh; font-size: 13px; }
.ifc-types label { display: flex; align-items: center; gap: 8px; padding: 3px 0; } .ifc-types i { margin-left: auto; font-style: normal; color: var(--muted); }
@media (max-width: 800px) { .ifc-wrap { grid-template-columns: 1fr; } .ifc-view { height: 50vh; } .dc-wide { grid-template-columns: 1fr; } }
.tpl-list .tpl { display: flex; align-items: center; gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--line-2); }

/* ================= Sjekklister ================= */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 10px; }
.tpl-pick { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); }
.tpl-pick:hover { border-color: var(--accent-line-2); background: var(--accent-soft); }
.tpl-pick span { font-size: 22px; } .tpl-pick small { color: var(--muted); }
.sl-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 12px; margin-bottom: 6px; background: #fff; }
.sl-item.ok { border-left: 3px solid #16a34a; } .sl-item.avvik { border-left: 3px solid var(--bad); background: #fff8f8; } .sl-item.ir { border-left: 3px solid #94a3b8; }
.sl-seg { display: flex; gap: 2px; background: var(--soft); border-radius: 9px; padding: 2px; flex: none; }
.sl-seg button { border: 0; background: transparent; padding: 5px 9px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.sl-seg button.on.ok { background: #16a34a; color: #fff; } .sl-seg button.on.avvik { background: var(--bad); color: #fff; } .sl-seg button.on.ir { background: #64748b; color: #fff; }
.sja-row { display: grid; grid-template-columns: 12px 1.4fr .8fr .8fr 1.4fr 1fr 20px; gap: 6px; align-items: center; margin-top: 6px; }
.rdot { width: 10px; height: 10px; border-radius: 50%; } .rdot.ok { background: #16a34a; } .rdot.warn { background: #f59e0b; } .rdot.bad { background: var(--bad); }
@media (max-width: 800px) { .sja-row { grid-template-columns: 12px 1fr 1fr; } }

/* ================= Graving, anbud, timer, tilgang ================= */
.pf-area { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.ab-card b { font-size: 13px; line-height: 1.3; display: block; }
.tbl.tm td.ot { color: #b45309; } .tbl.tm td.ot b { color: #b45309; }
.ok-dot { color: #16a34a; font-size: 11px; } .wait-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; vertical-align: middle; }
.acc-list { max-height: 50vh; overflow: auto; }

/* ===== Deling med samarbeidspartnere ===== */
:root { --delt: #7c3aed; --delt-soft: #f5f3ff; --delt-line: #ddd6fe; }
.delt-txt { color: #6d28d9; font-weight: 500; }
.delt-chip, .chip.delt-chip { background: var(--delt); color: #fff; font-weight: 600; }
.delt-btn { border-color: var(--delt-line) !important; color: #6d28d9 !important; background: var(--delt-soft) !important; }
.delt-banner { display: flex; gap: 12px; align-items: center; background: linear-gradient(90deg, #ede9fe, #f5f3ff); border: 1.5px dashed #a78bfa; color: #3b0764; border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; font-size: 13.5px; }
.delt-banner .small { color: #5b21b6; margin-top: 2px; }
.delt-badge { flex: none; background: var(--delt); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 5px 9px; border-radius: 999px; }
.phero.delt { outline: 2px dashed #a78bfa; outline-offset: -2px; }
.delt-root .subtabs button.active { color: #6d28d9; border-color: var(--delt); }
.delt-card.plc { border: 2px dashed #c4b5fd; }
.card.delt-card { border: 1.5px dashed #c4b5fd; background: var(--delt-soft); cursor: pointer; }
.badge-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #f59e0b; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.todo { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-weight: 500; }
.todo-card { border-color: #fbbf24 !important; box-shadow: 0 0 0 3px rgba(251,191,36,.18); }
.em-card { margin-bottom: 8px; }
code.pw { font-size: 18px; padding: 8px 12px; background: var(--soft); border-radius: 8px; display: inline-block; user-select: all; }

/* Avkrysning – «checklisteenkelt» */
.share { border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.share-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.plogo { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--delt-soft); color: #6d28d9; font-weight: 700; font-size: 13px; border: 1px solid var(--delt-line); }
.share-row { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-top: 1px solid var(--soft); }
.share-lbl { flex: none; width: 74px; font-size: 12px; color: var(--muted); padding-top: 7px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.share-users { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 8px; border-top: 1px solid var(--soft); margin-top: 4px; }
.ticks { display: flex; flex-wrap: wrap; gap: 6px; }
.ticks.col { flex-direction: column; }
.tick { display: inline-flex; gap: 7px; align-items: center; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 13px; cursor: pointer; user-select: none; transition: background .15s, border-color .15s; }
.ticks.col .tick { border-radius: 12px; padding: 10px 12px; }
.tick input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.tick.on { background: var(--accent-soft); border-color: var(--accent-line-2); color: var(--ink); }
.tick:hover { border-color: var(--accent-line-2); }
.tick.arv { opacity: .7; cursor: default; }
.pl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
@media (max-width: 600px) { .share-row { flex-direction: column; gap: 4px; } .share-lbl { padding-top: 0; } }
#right-body .delt-banner { flex-direction: column; align-items: flex-start; gap: 6px; }

/* ===== Anbudsregning ===== */
.ar-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 16px; }
.ar-kpis .kpi b { display: block; }
.ar-list tr[data-b] { cursor: pointer; } .ar-list tr[data-b]:hover td { background: var(--accent-soft); }
.bad-txt { color: var(--bad); font-weight: 600; } .warn-txt { color: #b45309; }
.ar-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ar-head h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.ar-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; position: sticky; top: 0; z-index: 3; }
.ar-sum > div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; box-shadow: var(--shadow-sm); }
.ar-sum span { display: block; font-size: 11.5px; color: var(--muted); } .ar-sum b { font-size: 16px; letter-spacing: -.01em; }
.ar-sum .hl { background: var(--accent); border-color: var(--accent); } .ar-sum .hl span, .ar-sum .hl b { color: var(--on-accent); } .ar-sum .hl b { font-size: 18px; }
.ar-sum .warn { background: #fffbeb; border-color: #fde68a; } .ar-sum .warn b { color: #b45309; }
.ar-tools { gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.ar-posts { margin: 0; } .ar-posts td, .ar-posts th { vertical-align: middle; }
.ar-posts tr.kap td { background: var(--soft); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-2); }
.ar-posts tr.pr { cursor: pointer; } .ar-posts tr.pr:hover td { background: var(--accent-soft); }
.ar-posts tr.pr.open td { background: var(--accent-soft); border-bottom: 0; }
.ar-posts tr.upr td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.ar-posts tr.ed > td { background: #fbfcfe; padding: 4px 12px 14px; }
.ar-posts tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); font-size: 15px; }
.ar-posts input.num, .res input.num { width: 92px; text-align: right; }
.ar-bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; margin-top: 5px; max-width: 260px; background: var(--soft); }
.ar-bar i, .ar-stack i { display: block; height: 100%; }
.ar-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; } .ar-legend i, i.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.pe-head { grid-template-columns: 90px 1fr 80px 1fr; margin-top: 6px; }
.res td { padding: 4px 6px; } .res input, .res select { width: 100%; }
.ar-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.ar-slider { display: flex; gap: 14px; align-items: center; } .ar-slider input { flex: 1; accent-color: var(--accent); } .ar-slider b { font-size: 20px; min-width: 70px; text-align: right; }
.ar-stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: 4px 0 12px; }
.lt-prev { font-size: 13px; } .letter table { width: 100%; border-collapse: collapse; margin: 10px 0; } .letter td, .letter th { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; }
.letter .num { text-align: right; } .letter tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); }
.lt-head { display: flex; justify-content: space-between; border-bottom: 3px solid var(--ink); padding-bottom: 8px; margin-bottom: 14px; }
.ek-row { display: grid; grid-template-columns: 200px 1fr 130px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; } .ek-row b { text-align: right; }
.ek-bar { height: 12px; background: var(--soft); border-radius: 6px; overflow: hidden; } .ek-bar i { display: block; height: 100%; border-radius: 6px; }
details.rec { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; } details.rec summary { cursor: pointer; }
@media (max-width: 900px) { .ar-grid { grid-template-columns: 1fr; } .pe-head { grid-template-columns: 1fr 1fr; } .ek-row { grid-template-columns: 1fr; } .ar-sum { position: static; } }
.pe input, .pe select { text-align: left; } .pe input.num { text-align: right; } .pe-head label { font-size: 12px; }

/* ===== UE-priser ===== */
.ue-mx th.ue-col { min-width: 150px; text-align: right; vertical-align: top; }
.ue-mx td { vertical-align: top; }
.ue-cell .btn { margin-top: 4px; } .ue-cell .chip { margin-top: 4px; }
.ue-cell.best { background: #f0fdf4; } .ue-cell.best b { color: #15803d; }
.rq-posts { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; }
.rq-kap { padding: 4px 0; border-bottom: 1px solid var(--soft); } .rq-kap:last-child { border-bottom: 0; }
.rq-kh { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.rq-p { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 3px 0 3px 22px; font-size: 13px; }
.sec-h { font-size: 15px; margin: 18px 0 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.pr-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pr-card { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px; cursor: pointer; font: inherit; color: inherit; }
.pr-card:hover { border-color: var(--accent-line-2); }
.pr-msg { background: var(--soft); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; white-space: pre-wrap; }
.pr-t input.num { width: 120px; text-align: right; }

/* ===== Tofaktor og innlogging ===== */
.tfa-card { max-width: 440px; }
.tfa-steps { padding-left: 18px; margin: 6px 0 10px; font-size: 13.5px; } .tfa-steps li { margin: 3px 0; }
.tfa-qr { display: flex; justify-content: center; } .tfa-qr svg { width: 200px; height: 200px; background: #fff; border-radius: 12px; padding: 6px; border: 1px solid var(--line); }
.tfa-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; } .tfa-codes code { font-size: 16px; text-align: center; padding: 6px; background: var(--soft); border-radius: 8px; }
.alert.ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* ---------- Innmåling ---------- */
.inm-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); border-left: 3px solid var(--c); white-space: nowrap; }
.inm-up { border-style: dashed; }
.inm-card { cursor: pointer; } .inm-card:hover { border-color: var(--accent); }
.inm-wrap { max-height: 56vh; overflow: auto; border: 1px solid var(--line-2); border-radius: 12px; }
.inm-t { margin: 0; font-size: 13px; } .inm-t td { vertical-align: top; padding: 7px 8px; } .inm-t select.input.sm { min-width: 104px; }
.inm-t tr.v-warn td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.inm-t tr.v-info td:first-child { box-shadow: inset 3px 0 0 #94a3b8; }
.txt-warn { color: #b45309; }
.alert.note { background: #fffbeb; border-color: #fde68a; color: #92400e; margin-bottom: 8px; }
.inm-tools label { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Grunn og miljø (automatiske varsler) ---------- */
.rk-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 12px 0; background: var(--soft, #f8fafc); }
.rk-card.bad { border-color: #fecaca; background: #fef2f2; } .rk-card.warn { border-color: #fde68a; background: #fffbeb; } .rk-card.ok { border-color: #bbf7d0; background: #f0fdf4; }
.rk-row { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; margin-top: 8px; }
.rk-ico { width: 20px; flex: none; text-align: center; } .rk-row.bad b { color: #b91c1c; } .rk-row.warn b { color: #b45309; }

/* ---------- Flåte: kjørebok og sporing ---------- */
.trip-row td { vertical-align: top; } .trip-sum { display: flex; gap: 18px; flex-wrap: wrap; margin: 8px 0 12px; }
.trip-sum div { background: var(--soft, #f8fafc); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.trip-sum b { display: block; font-size: 18px; } .pos-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.key-show { font-family: ui-monospace, Consolas, monospace; background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: 10px; word-break: break-all; }
.gr-link { font-size: 11.5px; color: var(--accent); white-space: nowrap; } .gr-hit { cursor: pointer; } .gr-hit:hover td { background: var(--accent-soft); }

/* ---------- Timer ---------- */
.tm-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 900px) { .tm-week { grid-template-columns: 1fr; } }
.tm-day { border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 120px; background: var(--card, #fff); display: flex; flex-direction: column; gap: 6px; }
.tm-day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tm-e { border-radius: 10px; padding: 6px 8px; background: var(--soft, #f8fafc); border-left: 3px solid #94a3b8; cursor: pointer; font-size: 13px; }
.tm-e.Sendt { border-left-color: #2563eb; } .tm-e.Godkjent { border-left-color: #16a34a; cursor: default; } .tm-e.Avvist { border-left-color: #dc2626; background: #fef2f2; }
.tm-add { margin-top: auto; align-self: flex-start; } .tm-appr { margin-bottom: 10px; }

/* ---------- Prosjektmeny: større, synlig og alltid tilgjengelig ---------- */
.panel.right { width: 500px; }
.ptabs { display: flex; flex-wrap: wrap; overflow: visible; gap: 6px; padding: 8px; position: sticky; top: -20px; z-index: 4;
  background: rgba(248, 250, 252, .96); backdrop-filter: blur(8px); box-shadow: 0 6px 14px -12px rgba(15, 23, 42, .5); }
.ptabs button { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; padding: 8px 12px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.ptabs button:hover { border-color: rgba(var(--accent-rgb), .5); background: rgba(var(--accent-rgb), .06); }
.ptabs button.active { background: var(--accent); color: var(--on-accent, #fff); border-color: var(--accent); box-shadow: 0 6px 14px -8px rgba(var(--accent-rgb), .8); }
.ptabs .ti { font-size: 15px; line-height: 1; }
.ptab-full ~ .ptabs, .phero.full ~ .ptabs { top: 0; }
.phero .phero-act { top: 14px; bottom: auto; right: 56px; }
.phero.full .phero-act { top: auto; bottom: 20px; right: 20px; }
.phero-act .btn.small { font-size: 13px; padding: 7px 12px; }
.panel.left .tabs button { font-size: 13.5px; padding: 9px 8px; }
.topbar .btn.ghost { font-size: 13.5px; padding: 8px 14px; }
@media (max-width: 760px) {
  .panel.right { width: auto; }
  .ptabs { top: -20px; }
  .ptabs button { font-size: 13px; padding: 7px 10px; }
  .phero .phero-act { right: 56px; }
}

/* ---------- Firmaprofil og rapportvalg ---------- */
.pf-grid { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; margin-bottom: 8px; }
.pf-logo { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pf-prev { width: 210px; height: 90px; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; background: #fff; padding: 8px; }
.pf-prev img { max-width: 100%; max-height: 74px; object-fit: contain; }
@media (max-width: 700px) { .pf-grid { grid-template-columns: 1fr; } }
.rp-typer { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 10px 0 4px; }
.rp-type { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.rp-type:hover { border-color: rgba(var(--accent-rgb), .5); }
.rp-type.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
.rp-ik { font-size: 22px; }
.rp-deler { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; }
label.chk { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; cursor: pointer; }

/* ---------- Varsler (bjelle) ---------- */
.vs-wrap { position: relative; }
.vs-btn { position: relative; font-size: 16px; padding: 7px 11px; }
.vs-n:empty { display: none; }
.vs-n { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.vs-box { position: absolute; right: 0; top: calc(100% + 8px); width: 380px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; background: #fff; color: var(--ink);
  border-radius: 14px; box-shadow: 0 20px 40px -12px rgba(15, 23, 42, .45); border: 1px solid var(--line); z-index: 60; }
.vs-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.vs-x { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.vs-item { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; }
.vs-item:hover { background: var(--soft); }
.vs-item > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.vs-item.bad { box-shadow: inset 3px 0 0 #dc2626; } .vs-item.warn { box-shadow: inset 3px 0 0 #f59e0b; } .vs-item.info { box-shadow: inset 3px 0 0 #3b82f6; }
.vs-ik { font-size: 16px; }
.vs-epost { padding: 10px 14px; font-size: 12.5px; color: var(--muted); }
/* signaturfelt i appen */
.sig { position: relative; height: 160px; border: 2px dashed #cbd5e1; border-radius: 12px; background: #fff; margin-top: 4px; touch-action: none; }
.sig canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.sig .sig-clear { position: absolute; top: 8px; right: 8px; }
.sig .sig-hint { position: absolute; left: 14px; bottom: 10px; color: #94a3b8; pointer-events: none; font-size: 13px; }
.sig.har .sig-hint { display: none; }
.rg-ed .input.sm { min-width: 0; } .rg-ed td { padding: 3px 4px; } .rg-ed .num { width: 80px; }
.rg-d { cursor: pointer; } .rg-d:hover { border-color: rgba(var(--accent-rgb), .5); }
.mk-over { background: #fffbeb; } .mk-ok { color: #15803d; } .mk-diff-pos { color: #b45309; font-weight: 600; }

/* ---------- Utboks (føring uten dekning) ---------- */
#utboks { position: fixed; left: 16px; bottom: 16px; z-index: 80; border: 0; border-radius: 999px; padding: 10px 16px; font: inherit; font-weight: 600;
  background: #0f172a; color: #fff; box-shadow: 0 10px 24px -10px rgba(15, 23, 42, .7); cursor: pointer; }
.rg-ed [data-f=tekst] { text-align: left; width: 100%; min-width: 180px; } .rg-ed td:nth-child(2) { width: 40%; }
@media (max-width: 760px) { .phero.full .phero-act { top: 14px; bottom: auto; right: 14px; } .phero.full .phero-act .btn.small { padding: 6px 10px; } }
