/* Eterano v1.14.1 — Books & controls layout polish */
#accountingBooksPane{--books-gap:18px}
#accountingBooksPane .books-intro{margin-bottom:var(--books-gap)}
#accountingBooksPane .books-two-column{gap:var(--books-gap);margin-bottom:var(--books-gap);align-items:stretch;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
#accountingBooksPane .books-two-column>.books-card{height:100%;display:flex;flex-direction:column}
#accountingBooksPane .books-two-column>.books-card>.section-heading.compact{margin-bottom:12px}
#accountingBooksPane .books-two-column:first-of-type>.books-card>.section-heading.compact{min-height:62px}
#accountingBooksPane .books-card{padding:20px}
#accountingBooksPane .books-list-row{min-height:54px}

/* Accountant center: calmer hierarchy and aligned controls */
.accountant-center1140{padding:20px!important;overflow:visible}
.accountant-head1140{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,360px);align-items:end;gap:24px}
.accountant-head1140 .section-heading{max-width:720px}
.accountant-year-controls1140{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px;width:100%}
.accountant-year-controls1140 label{min-width:0;margin:0;display:grid;gap:6px}
.accountant-year-controls1140 label>span{font-size:.78rem;font-weight:800;color:var(--muted)}
.accountant-year-controls1140 select,.accountant-year-controls1140 button{height:42px;min-height:42px;margin:0}
.accountant-summary1140{gap:12px;margin:18px 0 16px}
.accountant-kpi1140{min-height:92px;align-content:center;padding:14px 16px}
.accountant-tabs1140{margin-top:2px}
.accountant-content1140{margin-top:12px}
.readiness-intro1140{align-items:center;padding:15px 16px}
.readiness-list1140{gap:10px}
.readiness-row1140{min-height:64px;padding:11px 13px}

/* Keep the legacy setup forms visually paired and predictable */
#fiscalYearForm{grid-template-columns:1fr 1fr}
#fiscalYearForm>#fiscalYearName{grid-column:1/-1}
#fiscalYearForm>button{grid-column:1/-1}
#periodLockForm{align-content:start}
#fiscalYearList,#periodLockList{min-height:54px}
#accountMasterList,#vatMasterList{max-height:380px;overflow:auto;padding-right:3px}

/* Opening balances: stable header and numeric columns */
.opening-card .books-card-head{align-items:end}
.opening-card .books-card-head>.section-heading{margin-bottom:0;max-width:720px}
.opening-card .books-card-head>select{height:42px}
.books-table-head,.books-table-row{grid-template-columns:minmax(260px,1fr) 140px 140px;column-gap:12px}
.books-table-head>:nth-child(n+2),.books-table-row>:nth-child(n+2){text-align:right}
.books-totals{align-items:center}

/* Prevent the control trail from making the whole page endlessly tall. */
#correctionHistoryList,#accountingControlTrail{max-height:470px;overflow:auto;padding-right:4px;align-content:start}
#correctionHistoryList:empty,#accountingControlTrail:empty{min-height:54px}

/* Trial/audit surfaces */
.trial-head1140{padding:2px 2px 0}
.trial-table1140 th,.trial-table1140 td{white-space:nowrap}
.trial-table1140 th:first-child,.trial-table1140 td:first-child{white-space:normal;min-width:230px}
.audit-list1140{max-height:500px}
.audit-row1140{grid-template-columns:120px minmax(230px,.9fr) minmax(280px,1.35fr)}

@media(max-width:1050px){
  .accountant-head1140{grid-template-columns:1fr}
  .accountant-year-controls1140{grid-template-columns:minmax(0,1fr) auto;max-width:520px}
  #accountingBooksPane .books-two-column:first-of-type>.books-card>.section-heading.compact{min-height:0}
}
@media(max-width:900px){
  #accountingBooksPane .books-two-column{grid-template-columns:1fr}
  #accountingBooksPane .books-two-column>.books-card{height:auto}
  #correctionHistoryList,#accountingControlTrail{max-height:420px}
}
@media(max-width:620px){
  .accountant-center1140,#accountingBooksPane .books-card{padding:16px!important}
  .accountant-year-controls1140{grid-template-columns:1fr;max-width:none}
  .accountant-year-controls1140 button{width:100%}
  #fiscalYearForm{grid-template-columns:1fr}
  #fiscalYearForm>#fiscalYearName,#fiscalYearForm>button{grid-column:auto}
  .books-table-head,.books-table-row{grid-template-columns:minmax(220px,1fr) 120px 120px}
}
