/* =========================================================================
   Nytt utseende for kundeappen – samme oppsett som bakpanelet.
   Alt er under html.ny-layout og bare på brede skjermer, så det klassiske utseendet er urørt.
   Slås av i brukermenyen («Bytt til klassisk utseende»), se js/core/nylayout.js.
   ========================================================================= */
.brand-org { display: none; }
/* Strekikoner i prosjektkortene og visningsvalget (begge utseender) */
.plc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.plc-meta svg.ik { width: 14px; height: 14px; color: var(--muted); }
.seg button svg.ik { width: 15px; height: 15px; vertical-align: -3px; }

@media (min-width: 1000px) {
  html.ny-layout { --nl-w: 240px; }
  html.ny-layout .nl-over { --ok: #15803d; --ok-bg: #e9f7ee; --warn: #b45309; --warn-bg: #fef4e2; --bad: #c62828; --bad-bg: #fdecec; --info: #1d4ed8; --info-bg: #eaf1ff; }

  /* ---------- Sidemeny (topplinjen gjøres om til en kolonne) ---------- */
  html.ny-layout .topbar { position: fixed; inset: 0 auto 0 0; width: var(--nl-w); height: auto; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 16px 12px 12px; background: linear-gradient(180deg, #0b1324, #0f1b33); backdrop-filter: none; -webkit-backdrop-filter: none;
    border: 0; border-right: 1px solid rgba(255, 255, 255, .06); box-shadow: none; z-index: 25; }
  html.ny-layout .topbar > .grow { display: none; }
  html.ny-layout .topbar .brand { order: 0; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 11px; align-items: center; padding: 4px 8px 16px; }
  html.ny-layout .topbar .brand .logo { grid-row: span 2; width: 36px; height: 36px; border-radius: 11px; }
  html.ny-layout .topbar .brand-txt { display: block !important; font-size: 16px; line-height: 1.2; align-self: end; }
  html.ny-layout .topbar .brand-org { display: block; align-self: start; color: #7f8ea6; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.ny-layout .topbar .brand:not(:has(.brand-org)) .logo { grid-row: auto; }

  /* Adressesøket i kartet ligger øverst i sidemenyen */
  html.ny-layout #app .topbar .search { order: 1; flex: none; max-width: none; min-width: 0; margin: 0 0 10px; position: relative; }
  html.ny-layout #app .topbar .search input { width: 100%; }
  html.ny-layout #app .topbar .search-results { width: 420px; right: auto; z-index: 40; }

  html.ny-layout .app-nav { order: 2; display: flex !important; flex: 1 1 auto; min-height: 0; flex-direction: column; align-items: stretch; gap: 1px; padding: 0 0 10px;
    margin: 0; background: none; border: 0; border-radius: 0; box-shadow: none; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
  html.ny-layout .app-nav a { display: flex; align-items: center; gap: 11px; width: 100%; padding: 7px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 550; color: #aab6c8; box-shadow: none; flex: none; }
  html.ny-layout .app-nav a span { display: block !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.ny-layout .app-nav a svg.ik { width: 18px; height: 18px; flex: none; opacity: .8; }
  html.ny-layout .app-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  html.ny-layout .app-nav a.on { background: rgba(var(--accent-rgb), .2); color: #fff; box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .4); }
  html.ny-layout .app-nav a.on svg.ik { opacity: 1; color: var(--accent-hi); }
  html.ny-layout .app-nav a em { margin-left: auto; flex: none; font-style: normal; font-size: 11.5px; font-weight: 700; min-width: 20px; padding: 1px 6px; border-radius: 99px;
    text-align: center; background: rgba(255, 255, 255, .1); color: #cbd5e1; }
  html.ny-layout .app-nav a em.bad { background: #ef4444; color: #fff; }
  html.ny-layout .app-nav .nl-grp { padding: 12px 12px 4px; font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: #64748b; flex: none; }
  html.ny-layout .app-nav .nav-apper { display: none; }

  /* Bruker og varsler nederst */
  html.ny-layout .topbar .top-actions { order: 3; margin: 0; display: flex; align-items: center; gap: 4px; padding: 10px 2px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
  html.ny-layout .topbar .top-actions .user { flex: 1; min-width: 0; position: static; }
  html.ny-layout .topbar .user-btn.btn.ghost { width: 100%; justify-content: flex-start; height: 44px; padding: 0 8px 0 4px; color: #e2e8f0; }
  html.ny-layout .topbar .uname { display: block !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
  html.ny-layout .topbar .vs-btn { color: #aab6c8; }
  html.ny-layout .topbar .vs-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }
  html.ny-layout .topbar .user-menu { position: fixed; left: 12px; right: auto; top: auto; bottom: 68px; }
  html.ny-layout .topbar .vs-wrap { position: static; }
  html.ny-layout .topbar .vs-box { position: fixed; left: calc(var(--nl-w) + 10px); right: auto; top: auto; bottom: 12px; }

  /* ---------- Sidene ---------- */
  html.ny-layout .page { left: var(--nl-w); }
  html.ny-layout .page-main { padding: 28px 32px 60px; max-width: 1380px; }
  html.ny-layout .page-main h1 { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
  html.ny-layout .ms-head { margin-bottom: 20px; }
  html.ny-layout .ms-head p.muted { font-size: 14px; margin-top: 4px; }

  /* ---------- Kartet ---------- */
  html.ny-layout #map { left: var(--nl-w); }
  html.ny-layout #app .panel.left { top: 12px; left: calc(var(--nl-w) + 12px); }
  html.ny-layout #app .panel.right { top: 12px; }
  html.ny-layout #app .maplibregl-ctrl-top-right { top: 4px; }
  html.ny-layout .map-tools { top: 12px; left: calc(var(--nl-w) + 416px); }
  html.ny-layout .legend { left: calc(var(--nl-w) + 416px); }
  html.ny-layout .left-toggle { top: 12px; left: calc(var(--nl-w) + 12px); }

  /* ---------- Oversikten ---------- */
  html.ny-layout .nl-over .bp-head { margin-bottom: 20px; }
  html.ny-layout .nl-over .bp-head h1 { margin: 0; }
  html.ny-layout .nl-sok { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; min-width: 300px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
  html.ny-layout .nl-sok svg.ik { width: 16px; height: 16px; color: var(--muted); flex: none; }
  html.ny-layout .nl-sok input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 13.5px; flex: 1; min-width: 0; color: var(--ink); }
  html.ny-layout .nl-sok:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
  html.ny-layout .nl-over .bp-head-act .btn svg.ik { width: 16px; height: 16px; margin-right: 6px; }

  html.ny-layout .nl-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
  html.ny-layout .nl-kpi { text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
  html.ny-layout .nl-kpi:hover { border-color: #cbd5e1; box-shadow: 0 4px 14px -8px rgba(15, 23, 42, .25); }
  html.ny-layout .nl-kpi > span { display: flex; align-items: center; gap: 7px; }
  html.ny-layout .nl-kpi > span svg.ik { width: 15px; height: 15px; color: var(--muted); }

  html.ny-layout .nl-snarv { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  html.ny-layout .nl-snarv .btn { gap: 7px; background: var(--panel); }
  html.ny-layout .nl-snarv .btn svg.ik { width: 16px; height: 16px; color: var(--muted); }
  html.ny-layout .nl-dag { margin-bottom: 16px; }

  html.ny-layout .nl-grid > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
  html.ny-layout .nl-n { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--soft); border-radius: 99px; padding: 1px 8px; }
  html.ny-layout .nl-over .bp-li { width: calc(100% + 16px); text-align: left; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; background: transparent; }
  html.ny-layout .nl-over .bp-li.laast { cursor: default; opacity: .7; }
  html.ny-layout .nl-over .bp-li.laast > svg.ik { width: 15px; height: 15px; color: var(--muted); }
  html.ny-layout .nl-vl { display: flex; align-items: center; gap: 12px; min-width: 0; }
  html.ny-layout .nl-vi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--soft); color: var(--muted); }
  html.ny-layout .nl-vi svg.ik { width: 17px; height: 17px; }
  html.ny-layout .nl-vt { min-width: 0; }
  html.ny-layout .nl-vt b, html.ny-layout .nl-vt small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.ny-layout .nl-mer { margin-top: 8px; width: 100%; }
  html.ny-layout .nl-over .mer-bk { margin-top: 10px; }
  html.ny-layout .nl-over .mer-bk summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 0; }

  /* ---------- Prosjektsiden (fullskjerm) ---------- */
  html.ny-layout .page-main .pv.nl-pv { padding: 0; background: none; box-shadow: none; border: 0; }
  html.ny-layout .nl-pv { --ok: #15803d; --ok-bg: #e9f7ee; --warn: #b45309; --warn-bg: #fef4e2; --bad: #c62828; --bad-bg: #fdecec; --info: #1d4ed8; --info-bg: #eaf1ff; }
  html.ny-layout .nl-phead h1 { font-size: 25px; }
  html.ny-layout .nl-phead .bp-head-act .btn svg.ik { width: 16px; height: 16px; margin-right: 6px; }
  html.ny-layout .nl-pimg { width: 52px; height: 52px; border-radius: 15px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--line); }
  html.ny-layout .nl-pkpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
  html.ny-layout .nl-ptabs button { display: inline-flex; align-items: center; gap: 8px; position: relative; }
  html.ny-layout .nl-ptabs button svg.ik { width: 17px; height: 17px; color: var(--muted); }
  html.ny-layout .nl-ptabs button.on svg.ik { color: var(--accent); }
  html.ny-layout .nl-varsel { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; display: inline-block; }
  html.ny-layout .nl-psub { display: inline-flex; max-width: 100%; margin: -4px 0 16px; }
  html.ny-layout .nl-psub button { display: inline-flex; align-items: center; gap: 7px; }
  html.ny-layout .nl-psub .ti svg.ik { width: 15px; height: 15px; color: var(--muted); }
  html.ny-layout .nl-psub button.on .ti svg.ik { color: var(--accent); }
  html.ny-layout .nl-psub .tb { font-size: 11px; font-weight: 650; background: var(--soft); color: var(--ink-2); border-radius: 99px; padding: 0 7px; }
  html.ny-layout .nl-psub .tb.warn { background: var(--warn-bg); color: var(--warn); }
  html.ny-layout .nl-ptab { min-width: 0; }
  html.ny-layout .bp-head-act .btn svg.ik, html.ny-layout .bp-filter .btn svg.ik { width: 16px; height: 16px; margin-right: 6px; }
  html.ny-layout .bp-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
  html.ny-layout .bp-filter .input { width: auto; height: 38px; }
  html.ny-layout .nl-vis button { padding: 7px 10px; }

  /* ---------- Felles byggesteiner på alle sidene (kort, tabeller, faner, filtre) ---------- */
  html.ny-layout .page-main .ms-head { align-items: flex-end; margin-bottom: 20px; }
  html.ny-layout .page-main .ms-head h1 { margin: 0; }
  html.ny-layout .page-main .ms-head p { color: var(--muted); }
  html.ny-layout .page-main .ms-head .btn svg.ik { width: 16px; height: 16px; }
  html.ny-layout .page-main .box { background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); padding: 18px 20px; }
  html.ny-layout .page-main .box h3 { font-size: 15px; font-weight: 650; letter-spacing: -.005em; }
  html.ny-layout .page-main .box:has(> .tbl-wrap:only-child), html.ny-layout .page-main .box:has(> table.tbl:only-child) { padding: 0; overflow: hidden; }
  html.ny-layout .page-main .tbl { font-size: 13.5px; }
  html.ny-layout .page-main .tbl th { font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--muted); padding: 11px 14px; background: var(--soft); border-bottom: 1px solid var(--line); }
  html.ny-layout .page-main .tbl thead th { background: var(--soft); }
  html.ny-layout .page-main .tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2, var(--line)); vertical-align: middle; font-variant-numeric: tabular-nums; }
  html.ny-layout .page-main .tbl tbody tr:last-child td { border-bottom: 0; }
  html.ny-layout .page-main .tbl tr.click:hover td { background: #fafbfd; }
  html.ny-layout .page-main table.t { font-size: 13px; }
  html.ny-layout .page-main table.t th { font-size: 12px; font-weight: 600; color: var(--muted); }
  html.ny-layout .page-main table.t td, html.ny-layout .page-main table.t th { padding: 8px 8px; }
  html.ny-layout .page-main .toolbar { gap: 10px; margin-bottom: 16px; }
  html.ny-layout .page-main .toolbar .input { height: 38px; border-radius: 10px; }
  html.ny-layout .page-main .seg { background: #e5e9f0; border: 0; border-radius: 11px; padding: 3px; }
  html.ny-layout .page-main .seg button { padding: 7px 12px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
  html.ny-layout .page-main .seg button.on { background: var(--panel, #fff); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
  html.ny-layout .page-main .subtabs { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; gap: 4px; margin: 0 0 16px; }
  html.ny-layout .page-main .subtabs button { border-radius: 0; padding: 11px 14px; font-size: 14px; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; }
  html.ny-layout .page-main .subtabs button.active { color: var(--accent); border-bottom: 2px solid var(--accent); background: none; box-shadow: none; }
  html.ny-layout .page-main .plc { border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
  html.ny-layout .page-main .plc:hover { transform: none; border-color: #cbd5e1; box-shadow: 0 6px 18px -10px rgba(15, 23, 42, .3); }

  /* Været i et lyst kort */
  html.ny-layout .nl-vaer .wx { background: none; border: 0; padding: 0; min-height: 0; backdrop-filter: none; }
  html.ny-layout .nl-vaer .wx-now span { color: var(--muted); }
  html.ny-layout .nl-vaer .wx-days div { background: var(--soft); }
  html.ny-layout .nl-vaer .wx-days span { color: var(--muted); }
  html.ny-layout .nl-vaer .wx-warn { color: var(--warn, #b45309); }
  html.ny-layout .nl-vaer .wx .spinner { border-color: var(--line); border-top-color: var(--accent); }
}
