/* ============================================================
   SIDE-SPESIFIKK CSS for "Fri bokføring" (fri-bokforing.html).
   Alle regler er samlet her, uten overlappende duplikat-definisjoner.
   ============================================================ */

#fb_bokforingLayout{
  display:grid;
  grid-template-columns:minmax(520px,46%) minmax(560px,54%);
  gap:28px;
  align-items:start;
}

#fb_bokforingVenstre{min-width:0}

#fb_bokforingVenstre > .grid:first-child{
  max-width:none!important;
  grid-template-columns:minmax(300px,1fr) 220px!important;
}

#fb_bokforingVenstre table{
  width:520px!important;
  min-width:520px!important;
  max-width:520px!important;
  table-layout:fixed!important;
}

#fb_bokforingVenstre table th:nth-child(1),
#fb_bokforingVenstre table td:nth-child(1){
  width:90px!important;
  min-width:90px!important;
  max-width:90px!important;
}

#fb_bokforingVenstre table th:nth-child(2),
#fb_bokforingVenstre table td:nth-child(2),
#fb_bokforingVenstre table th:nth-child(3),
#fb_bokforingVenstre table td:nth-child(3){
  width:175px!important;
  min-width:175px!important;
  max-width:175px!important;
}

#fb_bokforingVenstre table th:nth-child(4),
#fb_bokforingVenstre table td:nth-child(4){
  width:40px!important;
  min-width:40px!important;
  max-width:40px!important;
}

#fb_bokforingVenstre table td:nth-child(2) select,
#fb_bokforingVenstre table td:nth-child(3) select{
  display:block!important;
  width:165px!important;
  min-width:165px!important;
  max-width:165px!important;
  box-sizing:border-box!important;
}

#fb_bokforingVenstre [style*="overflow-x:auto"]{
  width:530px!important;
  max-width:100%!important;
  overflow-x:hidden!important;
}

#fb_hoyreKvittering{
  width:100%;
  min-width:0;
  margin:0;
  padding-top:0!important;
  position:sticky;
  top:0!important;
  align-self:start!important;
}

#fb_hoyreKvittering > .card{
  width:100%;
  box-sizing:border-box;
  position:relative!important;
  margin-top:0!important;
  padding:10px!important;
  transition:border-color .15s ease,background .15s ease,box-shadow .15s ease!important;
}

#fb_hoyreKvittering > .card > div:first-child{margin-bottom:4px!important}

#fb_hoyreKvittering > .card.fb-drag-over{
  border:2px dashed #059669!important;
  background:#ecfdf5!important;
  box-shadow:0 0 0 4px rgba(5,150,105,.10)!important;
}

#fb_hoyreKvittering input[type=file]{
  width:100%!important;
  box-sizing:border-box;
}

#fb_hoyreKvittering input#fb_kvitteringFil{
  margin-top:6px!important;
  padding:5px 7px!important;
  min-height:32px!important;
}

#fb_dropHint{
  min-height:40px!important;
  height:40px!important;
  margin-top:5px!important;
  padding:0 8px!important;
  line-height:38px!important;
  border:2px dashed #94a3b8!important;
  border-radius:8px!important;
  text-align:center!important;
  font-size:13px!important;
  font-weight:700;
  color:#64748b;
  background:#f8fafc;
  cursor:copy!important;
  box-sizing:border-box!important;
}

#fb_dropHint.fb-drag-over,
#fb_hoyreKvittering.fb-drag-over #fb_dropHint,
#fb_hoyreKvittering > .card.fb-drag-over #fb_dropHint{
  border-color:#16a34a!important;
  background:#dcfce7!important;
  color:#166534!important;
}

#fb_kvitteringValgt{
  margin-top:5px!important;
  font-size:13px!important;
}

#fb_uploadStatus{
  margin-top:5px!important;
  padding:6px 8px!important;
  font-size:13px!important;
}

#fb_previewPanel{
  display:block!important;
  width:100%!important;
  margin-top:7px!important;
}

#fb_previewPanel > div:first-child{
  display:grid!important;
  grid-template-columns:minmax(120px,1fr) auto minmax(120px,1fr)!important;
  align-items:center!important;
  gap:10px!important;
}

#fb_previewNavn{
  grid-column:1!important;
  justify-self:start!important;
}

#fb_zoomKontroller{
  grid-column:2!important;
  justify-self:center!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
}

#fb_previewHandlinger{
  grid-column:3!important;
  justify-self:end!important;
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
}

#fb_previewFlate{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:center!important;
  width:100%!important;
  min-height:360px!important;
  max-height:720px!important;
  overflow:auto!important;
  background:#e5e7eb!important;
  padding:10px!important;
  box-sizing:border-box!important;
  text-align:center!important;
}

#fb_previewImg{
  display:none;
  width:auto!important;
  max-width:none!important;
  height:auto!important;
  object-fit:contain!important;
  transform-origin:top center!important;
  margin:0 auto!important;
}

#fb_previewPdfCanvas{
  width:auto!important;
  height:auto!important;
  max-width:none!important;
  display:block;
  margin:0 auto!important;
}

#fb_previewZoomInn,
#fb_previewZoomUt{
  min-width:82px!important;
  cursor:pointer!important;
  pointer-events:auto!important;
  position:relative!important;
  z-index:20!important;
}

#fb_previewZoomTxt{position:relative!important;z-index:10!important}

@media(max-width:1250px){
  #fb_bokforingLayout{grid-template-columns:1fr 1fr;gap:20px}
}

@media(max-width:950px){
  #fb_bokforingLayout{grid-template-columns:1fr}
  #fb_hoyreKvittering{position:static}
  #fb_previewFlate{min-height:320px!important;max-height:520px!important}
}

@media(max-width:700px){
  #fb_previewPanel > div:first-child{
    grid-template-columns:1fr!important;
    row-gap:8px!important;
  }
  #fb_previewNavn,
  #fb_zoomKontroller,
  #fb_previewHandlinger{
    grid-column:1!important;
    justify-self:center!important;
  }
}
