body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  margin: 0;
}

.main {
  display: flex;
  height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  width: 200px;
  background: #f8f9fa;
  padding: 10px;
}

.info-blok {
  flex-shrink: 0;
  padding: 10px;
  background: #e9e9e9;
  border-top: 1px solid #ccc;
  font-size: 0.9em;
}

.main-content {
  flex: 1;
  padding: 20px;
}

.faults {
  padding: 10px;
  background: #ffe0e0;
  color: #900;
}

.hidden {
  display: none;
}

.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
}

.overlay-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 4px;
}

.ui-menu {
  width: 150px;
  float: left;
}

.ui-menu .ui-menu-item-wrapper {
  font-size: 14px;
}

#menu-container {
  background-color: #ffffff;
  flex: 1 1 auto;
  overflow-y: auto;
  margin-bottom: 10px;
}

#datagrid {
  font-size: 11px;
  font-family: Arial,Helvetica,sans-serif;
  width: 100%;
  table-layout: fixed;
}

.table-wrapper {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

#tablecontainer {
  flex: 1 1 550px;
  border: 1px solid #ccc;
  padding: 10px;
  background-color: #fafafa;
  overflow-x: auto;
}

#tablecontainer2 {
  flex: 1 1 1000px;
  border: 1px solid #ccc;
  padding: 10px;
  background-color: #fafafa;
  overflow-x: auto;
}

#datagrid,
#datagrid2 {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

/* Beide tabellen (header + body) moeten table-layout: fixed krijgen */    
div.dataTables_scrollHead table,    
div.dataTables_scrollBody table {    
  table-layout: fixed;    
}

#datagrid th, #datagrid td,
#datagrid2 th, #datagrid2 td {
  border: 1px solid #ddd;
  padding: 4px;
  text-align: left;
}

div.dataTables_scrollHead th {
  font-size: 12px;
  font-weight: normal;
  padding: 2px 4px;
  text-align: left;
  line-height: 1.2;
}
/* Kolombreedtes in CSS als fallback */    

div.dataTables_scrollHead th:nth-child(1) { width: 20px; }
div.dataTables_scrollBody td:nth-child(1) { width: 48px; }

div.dataTables_scrollHead th:nth-child(2) { width: 50px; }
div.dataTables_scrollBody td:nth-child(2) { width: 78px; }

div.dataTables_scrollHead th:nth-child(3) { width: 40px; }
div.dataTables_scrollBody td:nth-child(3) { width: 68px; }

div.dataTables_scrollHead th:nth-child(4) { width: 20px; }
div.dataTables_scrollBody td:nth-child(4) { width: 48px; }

div.dataTables_scrollHead th:nth-child(5) { width: 22px; }
div.dataTables_scrollBody td:nth-child(5) { width: 50px; }

div.dataTables_scrollHead th:nth-child(6) { width: 20px; }
div.dataTables_scrollBody td:nth-child(6) { width: 48px; }

div.dataTables_scrollHead th:nth-child(7) { width: 200px; }
div.dataTables_scrollBody td:nth-child(7) { width: 228px; }

div.dataTables_scrollHead th:nth-child(8) { width: 30px; }
div.dataTables_scrollBody td:nth-child(8) { width: 58px; }

div.dataTables_scrollHead th:nth-child(9) { width: 30px; }
div.dataTables_scrollBody td:nth-child(9) { width: 58px; }

div.dataTables_scrollHead th:nth-child(10) { width: 30px; }
div.dataTables_scrollBody td:nth-child(10) { width: 58px; }

div.dataTables_scrollHead th:nth-child(11) { width: 30px; }
div.dataTables_scrollBody td:nth-child(11) { width: 58px; }

div.dataTables_scrollHead th:nth-child(12) { width: 20px; }
div.dataTables_scrollBody td:nth-child(12) { width: 48px; }

div.dataTables_scrollHead th:nth-child(13) { width: 24px; }
div.dataTables_scrollBody td:nth-child(13) { width: 52px; }

.form-container {
  background-color: #8a8a8a;
  border: 3px solid #505050;
  padding: 1rem;
  border-radius: 4px;
  max-width: 800px;
}

.formheader {
  background-color: #505050;
  color: white;
  padding: 0.5rem;
  text-align: center;
  font-weight: bold;
  width: 100%;
}

.formcontent {
  background-color: #f0f0f0;
  padding: 1rem;
  border-radius: 4px;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-row label {
  min-width: 150px;
  font-weight: bold;
  text-align: right;
}

.form-row input[type="text"],
.form-row select {
  flex: 1;
  padding: 0.3em;
  box-sizing: border-box;
}

.field-group {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

input[readonly] {
  background-color: #f5f5f5;
}

#debcred, #reknr, #tegenreknr, #btwrek {
  width: 80px;
  flex: 0 0 80px;
}

#boeknr, #boekregel {
  width: 120px;
  flex: 0 0 120px;
}
#bedragin, #btwbedrag, #bedragex {
  width: 120px;
  flex: 0 0 120px;
}

@media (max-width: 768px) {
  .table-wrapper {
    flex-direction: column;
  }
}