body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background: #ddd;
  overflow: hidden;
}

#tooltip {
    position: absolute;
    background: #fff;
    border: 1px solid #666;
    padding: 8px;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    z-index: 10000;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
	transition: opacity 0.15s ease;
}

#tooltip table {
    border-collapse: collapse;
    font-size: 12px;
	white-space: nowrap;
}

#tooltip td, #tooltip th {
    border: 1px solid #aaa;
    padding: 4px 6px;
	white-space: nowrap;
}

#parking {
	display: none;
}

#beszamolo{
	width: 100%;
}

.beszamolo-caption {
  text-align: center;
  font-weight: 600;
  font-size: 20px;
  margin-bottom: 8px;
}

.tables-wrap {
  display: flex;
  gap: 24px;
  align-items: stretch;
  font-family: sans-serif;
}

.balancesheet-table {
  display: flex;
  flex-direction: column;
  border: 1px solid #aaa;
  border-radius: 6px;
  overflow: hidden;
  background: #f9f9f9;
  min-width: 180px;
  width: 48%;
}

.balancesheet-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  align-items: center;
  box-sizing: border-box;
  border-bottom: 1px solid #ddd;
}

.balancesheet-header {
  background: #eee;
  font-weight: 600;
}

.balancesheet-num {
  text-align: right;
  min-width: 50px;
}

.szint1{
	font-weight: bold;
	color: blue;
}

.szint2{
	font-weight: bold;
}

#beszamoloEredmenyTable{
	width: 60%;
}

#panelContent{
	padding: 20px;
}

#overlayContent{
	padding: 20px;
}

.closeButton{
  right: 0px;
}

.fok-table{
  width: 100%;
  border-collapse: separate; /* szellősebb */
  border-spacing: 0;     /* függőleges spacing sorok között */
  font-family: Arial, sans-serif;
  font-size: 16px;
  border: 1px solid black;
}

.fok-table caption {
  text-align: center;
  font-weight: 600;
  font-size: 20px;
  margin-bottom: 8px;
}

.fok-table th,
.fok-table td {
  padding: 12px 16px; /* tágas cellák */
  border: 1px solid #AAA;
}

.fok-table tbody {
  border-spacing: 0 8px;      /* csak a tbody sorai között legyen spacing */
}

.fok-table thead th {
  background: #f3f4f6;
  font-weight: 600;
  text-align: center; /* csoportosított fejlécek középre */
  padding: 12px 16px;
}

.fok-table tbody tr {
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid black;
}

.fok-table .num {
  text-align: right;             /* jobbra zárt számok */
  font-variant-numeric: tabular-nums; /* szép oszlopos számok */
}

.sumCaption{
	text-align: left;
}

#upperbar {
  display: flex;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

#msgbox {
  flex: 2 1 0;
  text-align: left;
  margin: 18px 30px;
  height: 20px;
  display: flex;
  gap: 5px;
}

#panelStack {
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  min-width: 0;
  overflow: hidden;
  width: 0;
  transition: width 0.3s ease;
}

.panel {
  width: 50vw;       /* vagy %, vagy px */
  flex-shrink: 0;
  overflow: hidden;
  border-left: 1px solid #ccc;
  background: #fff;
  transition: width 0.3s ease;
  z-index: 10;
}

#overlayPanel {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: #fff;
  z-index: 0;

  transform: translateX(+100%);
  transition: transform 0.3s ease;
}

.hibafelirat{
	padding: 4px;
}

.hiba {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 3px solid #ffbdbd;
    min-width: 32px;
    flex-shrink: 0;
    cursor: pointer;
    padding: 2px 4px;
    height: 32px;
    line-height: 20px;
    background-color: #ffbdbd;
	border-radius: 10px;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
}

.hiba:hover{
    border: 3px solid red;
    background-color: red;
}

#controls {
  flex: 1 1 0;
  text-align: right;
  margin: 10px 22px;
}

#controls button {
  padding: 6px 12px;
  margin: 0 5px;
  font-size: 14px;
  cursor: pointer;
}

#viewport {
  margin: 0 auto;
  border: 2px solid #444;
  overflow: hidden;
  position: relative;
  cursor: grab;
}

#frame {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#sceneContainer {
  flex: 1 1 auto;
  min-width: 0;      /* 🔴 kötelező */
  overflow: hidden;
}

#scene {
  width: 100%;
  height: 100%;
  transform-origin: 0 0;  /* ✔ marad */
}

#sidePanel {
  width: 0;           /* alapból nincs */
  overflow: hidden;
  background: #f5f5f5;
  border-left: 1px solid #ccc;
  transition: width 0.3s ease;
}

.object {
  position: absolute;
  width: 240px;
  height: 180px;
  background: #f5f5f5;
  border: 0px solid #333;
  cursor: pointer;
}

.object:hover {
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

.part {
  position: absolute;
  width: 40px;
  height: 40px;
  border-bottom: 1px solid #456;
}

.konyvoldal {
  position: absolute;
  min-height: 40px;
}

.t_oldal {
  border-right: 1px solid #456;
}

.k_oldal {
  border-left: 1px solid #456;
}

.editDiv{
	width: 118px !important;
}

.input-a {
  width: 30px;
}

.input-b {
  width: 60px;
  text-align: right;
}

.row,
.row-kiindulas,
.editor {
  display: flex;
  align-items: center;
  gap: 6px;              /* szellősség */
  padding: 2px 2px;
  min-height: 25px;       /* nagyon fontos */
  box-sizing: border-box;
}

.row-kiindulas{
  color: #777;
}

/* MEGJELENÍTETT SOR */
.row {
  cursor: pointer;
}

.row .col {
  flex: 1;
  padding: 2px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* EDITOR */
.editor input {
  flex: 1;                /* kitölti a helyet */
  padding: 2px 2px;
  font-size: 14px;
  display: block;          /* biztosan látszódjon */
}

.cell {
  width: 120px;
}

.cell-b {
  text-align: right;
}

.row:hover {
  background: #f5f5f5;
}

.editor input:focus {
  outline: none;
  border: 1px solid #4a90e2;
}

.scale-content{
    transform-origin: top center;
}

/* Tablet workspace: pan the background/headers; scroll entries and reports normally. */
* { box-sizing: border-box; }
html, body { height: 100%; }
[hidden] { display: none !important; }
#upperbar { align-items: center; flex-wrap: wrap; padding: 8px 12px; }
#msgbox { margin: 0; height: auto; min-height: 44px; flex-wrap: wrap; align-items: center; }
#controls { margin: 0; flex: 0 1 auto; display: flex; flex-wrap: wrap; gap: 6px; }
button { min-height: 44px; min-width: 44px; padding: 8px 12px; cursor: pointer; }
#controls button { margin: 0; }
#controls button,
.panel > div:first-child > button,
#overlayPanel > div:first-child > button {
  height: 34px;
  min-height: 34px;
  padding: 4px 10px;
}
#languageToggle { display: inline-flex; justify-content: center; align-items: center; }
#languageToggle img { display: block; width: 28px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px #0002; }
.account-heading { display: grid; grid-template-columns: 14px minmax(0, 1fr) 14px; align-items: center; gap: 2px; padding: 2px; }
.account-heading > :last-child { text-align: right; }
.account-name { font-size: 13px; line-height: 16px; text-align: center; overflow-wrap: anywhere; }
button:focus-visible, .konyvoldal:focus-visible { outline: 3px solid #175cc4; outline-offset: 2px; }
#viewport { height: calc(100dvh - 76px); }
#sceneContainer { touch-action: none; user-select: none; }
.konyvoldal { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; }
.row, .row-kiindulas { height: 26px; min-height: 26px; gap: 2px; padding: 0 2px; }
.cell-a { width: 32px; flex: 0 0 32px; }
.cell-b { width: auto; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.editor { display: grid; grid-template-columns: calc(3ch + 10px) minmax(0, 1fr); height: 26px; min-height: 26px; gap: 4px; padding: 0 2px; background: #fff; }
.editor input { width: 100%; min-width: 0; height: 26px; min-height: 26px; padding: 1px 2px; border: 1px solid #aab4bf; border-radius: 4px; font-size: 16px; user-select: text; }
/* A top-layer popover keeps controls above entries and outside scrolling/zoom clipping. */
.editor-tools { position: fixed; inset: auto; margin: 0; padding: 4px; border: 1px solid #d6dce3; border-radius: 6px; background: #fff; box-shadow: 0 3px 10px #0002; max-width: calc(100vw - 16px); }
.editor-tools:has(.entry-error:not(:empty)) { width: 220px; }
.editor-actions { display: flex; justify-content: flex-end; gap: 8px; }
.editor-actions button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; min-width: 28px; min-height: 28px; padding: 4px; border: 1px solid transparent; border-radius: 5px; }
.editor-actions svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.save-entry { color: #16733b; background: #edf8f0; }
.cancel-entry { color: #b42332; background: #fff0f0; }
.save-entry:hover { background: #d6efde; border-color: #8bc9a0; }
.cancel-entry:hover { background: #fbdadd; border-color: #e3a0a8; }
.editor-actions button:active { transform: translateY(1px); }
.entry-error { grid-column: 1 / -1; color: #a01818; font-size: 13px; overflow-wrap: anywhere; }
.entry-error:empty { display: none; }
input[aria-invalid="true"] { border: 2px solid #a01818; }
.panel, #overlayPanel { overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; }
.panel > div:first-child, #overlayPanel > div:first-child {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
#overlayPanel { visibility: hidden; pointer-events: none; z-index: 20; }
#overlayPanel.is-open { transform: translateX(-100%); visibility: visible; pointer-events: auto; }
#panelContent, #overlayContent { padding: 12px; transform: none; }
.fok-table { min-width: 560px; }
#forgKimutatasTable { min-width: 700px; }
.tables-wrap { gap: 12px; }
.balancesheet-table { flex: 1; width: auto; min-width: 240px; }
.balancesheet-tableEredmeny { width: 100%; }
.balancesheet-row { gap: 12px; min-height: 44px; }
/* Equal-height balance-sheet sides, with matching headers and final totals.
   Only detail rows share the extra space on the side with fewer rows. */
.tables-wrap > .balancesheet-table > .balancesheet-row { flex: 1 0 auto; }
.tables-wrap > .balancesheet-table > .balancesheet-header,
.tables-wrap > .balancesheet-table > .mfo { flex: 0 0 44px; }
.balancesheet-num { flex-shrink: 0; }
.balancesheet-row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.tables-wrap > .balancesheet-table > .balancesheet-header,
.tables-wrap > .balancesheet-table > .mfo { padding-top: 4px; padding-bottom: 4px; font-size: 14px; line-height: 16px; }
.fok-table td:first-child { min-width: 160px; max-width: 260px; overflow-wrap: anywhere; }
#journalView { flex: 1 1 auto; min-width: 0; padding: 16px; background: #fff; overflow: auto; touch-action: pan-x pan-y pinch-zoom; overscroll-behavior: contain; cursor: auto; }
.journal-table { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.journal-table caption { text-align: left; font-size: 20px; font-weight: 600; padding-bottom: 12px; }
.journal-table th, .journal-table td { border: 1px solid #ccd2d9; padding: 8px; text-align: left; overflow-wrap: anywhere; }
.journal-table th { background: #eef1f4; }
.journal-table th:first-child { width: 55px; }
.journal-table th:nth-child(2) { width: 22%; }
.journal-table th:nth-child(5), .journal-table th:nth-child(6) { width: 13%; }
.journal-table input, .journal-table select { width: 100%; min-width: 0; height: 34px; font-size: 16px; padding: 3px; border: 1px solid #aab4bf; border-radius: 4px; }
.journal-table .amount, #journalDebitAmount, #journalCreditAmount { text-align: right; font-variant-numeric: tabular-nums; }
.journal-table tfoot { background: #f6f8fb; }
.journal-actions { margin-top: 12px; }
#journalError { color: #a01818; }
#journalStatus { color: #16733b; }
.tooltipCatch { cursor: help; }

@media (max-width: 1024px) and (orientation: portrait), (max-width: 760px) {
  #panelStack.is-open { width: 100% !important; flex-shrink: 0; }
  #overlayPanel { width: 100%; }
  #overlayPanel.is-open { transform: translateX(0); }
  .tables-wrap { flex-wrap: wrap; }
  .balancesheet-table { min-width: 260px; }
}

@media (pointer: coarse) {
  .konyvoldal { scrollbar-width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, #panelStack, #overlayPanel { transition: none; }
}

.journal-editable { cursor: pointer; }
.journal-editable:hover, .journal-editable:focus { background: #f0f7ff; }
.journal-editing { background: #f0f7ff; }
.journal-editing { height: var(--journal-row-height); }
.journal-editing td { vertical-align: middle; padding: 2px; }
.journal-editing input, .journal-editing select { height: min(34px, calc(var(--journal-row-height) - 5px)); }
.journal-edit-tools:has(.journal-edit-error:not(:empty)) { width: 220px; }
.journal-edit-error { color: #a01818; font-size: 13px; text-align: left; }

/* Row actions occupy no layout space and remain reachable by keyboard or touch. */
.row-delete-cell { position: relative; }
button.delete-row { z-index: 2; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; min-width: 18px; min-height: 18px; padding: 0; border: 1px solid #b42332; border-radius: 50%; color: #b42332; background: #fff; opacity: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.delete-row svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; pointer-events: none; }
button.delete-row:hover, button.delete-row:focus-visible { opacity: 1; background: #fff0f0; }
@media (hover: none) { button.delete-row { opacity: 1; } }

.delete-confirmation { width: min(400px, calc(100vw - 32px)); padding: 26px; border: 1px solid #dce2e8; border-radius: 16px; background: #fff; color: #243444; box-shadow: 0 18px 60px #14283d33; }
.delete-confirmation::backdrop { background: #14283d66; backdrop-filter: blur(3px); }
.delete-confirmation h2 { margin: 0 0 10px; font-size: 21px; }
.delete-confirmation p { margin: 0 0 24px; color: #596575; line-height: 1.5; }
.delete-confirmation form { margin: 0; }
.delete-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.delete-dialog-actions button { padding: 10px 18px; border: 1px solid #ccd5df; border-radius: 8px; font-size: 15px; background: #fff; cursor: pointer; }
.delete-dialog-actions .confirm-delete { border-color: #b42332; background: #b42332; color: #fff; }
.delete-dialog-actions .confirm-delete:hover { background: #951b29; }

#postingSaveStatus { font-size: 12px; color: #596575; }
#postingSaveStatus.save-error { color: #b42332; }
