/*
 * Order 2 — handelsbolagets och kommanditbolagets bokslut och INK4 (facit o2-1 till o2-11). Bygger på
 * order 1:s komponenter (public/css/o4/ef-ne.css, roten .efne) och lägger till det facit har utöver dem:
 * tabellerna på dator med kort på mobil, delägardialogen, INK4DU som blankett och korten med N3A och N3B.
 * Allt är scopat under .efne. Grundens delade filer ändras inte.
 */

/* Tabellerna (delägarna, kapitalet, fördelningen, förändring i eget kapital) */
.efne .tab { width: 100%; border-collapse: collapse; font-size: 14px; }
.efne .tab th { padding: 8px 10px; text-align: left; font-size: 12px; font-weight: 600; color: var(--dampad); border-bottom: 1px solid var(--linje); white-space: nowrap; }
.efne .tab th.num { text-align: right; }
.efne .tab td { padding: 9px 10px; border-bottom: 1px solid #F0F1F4; vertical-align: top; }
.efne .tab tr:last-child td { border-bottom: 0; }
.efne .tab .hb-summa td { font-weight: 600; border-top: 1px solid var(--black); }
.efne .hb-namn { display: block; font-weight: 600; overflow-wrap: anywhere; }
.efne .hb-blk { display: block; }
.efne .hb-saknas { color: var(--warning); font-weight: 500; }
.efne .hb-mobil { display: none; }
.efne .mr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid #F0F1F4; }
.efne .mr:last-child { border-bottom: 0; }
.efne .mr > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.efne .hb-mkort { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--linje); }
.efne .hb-mkort:last-child { border-bottom: 0; }
.efne .hb-mkort > .sm { margin-bottom: 4px; }

/* Bokslutsformens val */
.efne .hb-val { display: flex; flex-direction: column; gap: 8px; }
.efne .val.val--av { cursor: not-allowed; background: var(--yta); color: var(--grafit); }
.efne .val.val--av input { cursor: not-allowed; }

/* Årets handling: gruppens rubrik i K2:s årsbokslut */
.efne .hb-grupp { margin: 10px 0 2px; font-size: 13px; font-weight: 600; color: var(--grafit); }
.efne .hb-grupp:first-child { margin-top: 0; }

/* Årsredovisningen (facit 10): tabellen kant i kant i kortet, och på mobil delarna först. */
.efne .hb-kb-tabell { padding: 0; }
.efne .hb-tabrull { overflow-x: auto; }
.efne .hb-ar-vanster { flex: 1.6 1 520px; }
.efne .hb-ar-hoger { flex: 1 1 320px; }
.efne .hb-tabrull .tab th { white-space: normal; vertical-align: bottom; }
.efne .hb-tabrull .tab th, .efne .hb-tabrull .tab td { padding-left: 8px; padding-right: 8px; }
.efne .hb-tabrull .tab th:first-child, .efne .hb-tabrull .tab td:first-child { padding-left: 16px; }
.efne .hb-tabrull .tab th:last-child, .efne .hb-tabrull .tab td:last-child { padding-right: 16px; }

/* Kontrollen överst i delägarnas kapital */
.efne .hb-kontroll .kb { padding: 0; }
.efne .hb-kontroll .kon { border-top: 0; }

/* Delägardialogen */
.efne.hb-dialog { gap: 14px; padding: 4px 0 0; }
.efne.hb-dialog .h3 { margin: 0; font-family: var(--font-heading); font-size: 18px; font-weight: 600; }
.efne select.in { width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--linje-falt); border-radius: var(--radius-sm); font: inherit; background: var(--kort); color: var(--black); box-sizing: border-box; }
.efne .hb-dialog__fot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.efne .hb-dialog__hoger { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 8px; }
.efne .knapp.hb-ta-bort { color: var(--danger); border-color: #F3C7C7; }

/* INK4DU som blankett (facit 8) */
.efne .hb-blankett { display: flex; flex-direction: column; gap: 12px; padding: 24px 40px; border: 1px dashed var(--linje-falt); border-radius: 2px;
  background: repeating-linear-gradient(135deg, #FFFFFF 0 14px, #F4F5F7 14px 28px); box-shadow: var(--shadow); }
.efne .hb-blankett__huvud { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-bottom: 10px; border-bottom: 2px solid var(--black); }
.efne .hb-blankett__titel { margin: 0; font-family: var(--font-heading); font-size: 16px; font-weight: 700; }
.efne .hb-blankett__fakta { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.efne .hb-blankett__fakta > div { display: flex; flex-direction: column; }
.efne .hb-blankett__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.efne .tab.hb-du { min-width: 820px; }
.efne .tab.hb-du td { vertical-align: top; }
.efne .tab.hb-du th { white-space: normal; vertical-align: bottom; }
.efne .tab.hb-du td.num { padding-top: 12px; }
.efne .hb-ruta { display: inline-flex; align-items: center; justify-content: flex-end; box-sizing: border-box; min-width: 120px; min-height: 30px; padding: 0 8px;
  font-variant-numeric: tabular-nums; color: #111; border: 1px solid var(--linje-falt); border-radius: 2px; background: #FFFFFF; }
.efne .hb-ruta--bokforing { border-color: #C9D4FB; background: #F3F6FF; }
.efne .hb-ruta--steg { border-color: #A9D9C4; background: #EAF6F0; }
.efne .hb-ruta--manuell { border-color: #E9CF86; background: #FFF6DA; }
.efne .hb-ruta-falt { display: inline-flex; align-items: center; gap: 4px; }
.efne input.hb-ruta--in { width: 120px; text-align: right; font: inherit; outline: none; border-color: #C9D4FB; background: #F3F6FF; }
.efne input.hb-ruta--in.hb-ruta--manuell { border-color: #E9CF86; background: #FFF6DA; }
.efne input.hb-ruta--in:focus { border-color: var(--bla); box-shadow: 0 0 0 2px rgba(36,71,214,.25); }
.efne .hb-du-del { display: flex; flex-direction: column; padding-bottom: 6px; }
.efne .hb-du-del .hb-namn { margin: 10px 0 2px; }
.efne .hb-du-rad { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 8px 0 8px 40px; border-bottom: 1px solid #E6E8EC; }
.efne .hb-du-rad > span:first-child { overflow-wrap: anywhere; }
.efne .hb-reset { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--warning); color: #FFFFFF; cursor: pointer; line-height: 1; padding: 0; }

/* Underlag för delägarna (facit 9a, 9b) */
.efne .hb-kort-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 14px; align-items: start; }

@media (max-width: 760px) {
  .efne .hb-dator { display: none; }
  .efne .hb-mobil { display: block; }
  .efne .hb-kort-grid { grid-template-columns: minmax(0, 1fr); }
  .efne select.in { min-height: 50px; font-size: 16px; border-radius: var(--radius-lg); padding: 0 12px; }
  .efne .hb-dialog__hoger { margin-left: 0; width: 100%; }
  .efne .hb-dialog__hoger .knapp, .efne .hb-dialog__hoger .prim, .efne .hb-dialog__fot .hb-ta-bort { flex: 1 1 auto; min-height: 46px; }
  .efne .hb-blankett { padding: 12px; }
  .efne .hb-kb-tabell { padding: 14px 16px; }
  .efne .hb-ar-spalter { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .efne .hb-ar-spalter > .spalt { display: contents; }
  .efne .hb-ar-spalter [data-hb-delarna] { order: -1; }
  .efne .hb-ar-spalter [data-hb-underskriftkort] { order: 1; }
}
