/* DOJ unified table sizing system – v4.0.48
   Single source of truth for column widths.
   Rule: header always visible; content grows naturally up to its semantic cap. */
:root{
  --table-row-pad-y:7px;
  --table-row-pad-x:8px;
  --table-font-size:13px;
}

.smart-table-scroll-host,
.table-scroll,
.table-wrap,
.lawyer-table-scroll,
.legal-list-table-wrap,
.trade-license-table-scroll,
.fee-public-table-wrap,
.bonus-table-scroll{
  max-width:100%;
  overflow-x:auto;
  overflow-y:visible;
  scrollbar-gutter:stable;
}

table[data-smart-columns-ready="1"]{
  width:max(100%,var(--smart-table-width));
  min-width:var(--smart-table-width);
  border-collapse:collapse;
  table-layout:fixed;
}

table[data-smart-columns-ready="1"] th,
table[data-smart-columns-ready="1"] td{
  box-sizing:border-box;
  width:var(--smart-col-width);
  min-width:var(--smart-col-width);
  max-width:var(--smart-col-width);
  padding:var(--table-row-pad-y) var(--table-row-pad-x);
  font-size:var(--table-font-size);
  line-height:1.28;
  vertical-align:middle;
}

/* Überschriften sind immer vollständig sichtbar und bleiben einzeilig. */
table[data-smart-columns-ready="1"] th{
  white-space:nowrap!important;
  overflow:visible!important;
  text-overflow:clip!important;
  word-break:normal!important;
  overflow-wrap:normal!important;
  hyphens:none!important;
  font-size:12px;
  line-height:1.18;
}

/* Normale Textspalten dürfen erst an ihrer semantischen Maximalbreite umbrechen. */
table[data-smart-columns-ready="1"] [data-smart-column-wrap="1"]{
  white-space:normal!important;
  word-break:normal!important;
  overflow-wrap:break-word!important;
  hyphens:auto;
}

/* Strukturierte Werte bleiben immer vollständig in einer Zeile. */
table[data-smart-columns-ready="1"] [data-smart-column-nowrap="1"]{
  white-space:nowrap!important;
  word-break:keep-all!important;
  overflow-wrap:normal!important;
  text-overflow:clip!important;
}

/* Aktionen bleiben kompakt und beim horizontalen Scrollen sichtbar. */
table[data-smart-columns-ready="1"] th[data-smart-column-kind="actions"],
table[data-smart-columns-ready="1"] td[data-smart-column-kind="actions"]{
  position:sticky;
  right:0;
  z-index:4;
  white-space:nowrap!important;
  background:#0b0a08;
  box-shadow:-8px 0 12px -12px rgba(0,0,0,.9);
}
table[data-smart-columns-ready="1"] th[data-smart-column-kind="actions"]{
  z-index:7;
  background:#17130c;
}
table[data-smart-columns-ready="1"] tbody tr:nth-child(even) td[data-smart-column-kind="actions"]{background:#0d0b08}
table[data-smart-columns-ready="1"] tbody tr:hover td[data-smart-column-kind="actions"]{background:#181207}

table[data-smart-columns-ready="1"] td[data-smart-column-kind="actions"]{
  padding-left:5px;
  padding-right:5px;
}
table[data-smart-columns-ready="1"] td[data-smart-column-kind="actions"] .table-actions{
  gap:4px!important;
  align-items:center!important;
  justify-content:center!important;
  flex-wrap:nowrap!important;
}
table[data-smart-columns-ready="1"] td[data-smart-column-kind="actions"] :is(.icon-button,button.icon-button){
  width:30px!important;
  min-width:30px!important;
  max-width:30px!important;
  height:30px!important;
  min-height:30px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}

/* Tabellen-Werkzeuge bleiben flach und platzsparend. */
.column-control-bar{padding:7px 9px!important;min-height:42px!important;gap:8px!important}
.column-control-summary small{display:none!important}
.column-control-summary strong{font-size:12px!important}
.column-control-actions{gap:6px!important}
.column-control-actions button{min-height:30px!important;padding:5px 9px!important;font-size:12px!important}
.table-density-button{display:none!important}

.table-toolbar,
.trade-license-filter,
.employee-table-toolbar,
.former-employee-toolbar,
.lawyer-toolbar,
.page-local-search{padding:9px 10px!important;gap:8px!important}
.table-toolbar input,.table-toolbar select,
.trade-license-filter input,.trade-license-filter select,
.employee-table-toolbar input,.employee-table-toolbar select,
.former-employee-toolbar input,.former-employee-toolbar select,
.lawyer-toolbar input,.lawyer-toolbar select,
.page-local-search input,.page-local-search select{
  min-height:34px!important;
  height:34px!important;
  padding-top:5px!important;
  padding-bottom:5px!important;
  font-size:13px!important;
}

/* v4.0.48: linke Schluesselspalten bewegen sich horizontal ueberhaupt nicht.
   Quickview ist eine feste Utility-Spalte; die fachliche Schluesselspalte sitzt
   dauerhaft direkt rechts daneben. Fachliche Spaltenbreiten bleiben dynamisch. */
table[data-smart-columns-ready="1"][data-quick-view-ready="1"]{
  --quick-view-sticky-width:48px;
}
table[data-smart-columns-ready="1"][data-quick-view-ready="1"] :is(th.quick-view-trigger-head,td.quick-view-trigger-cell){
  position:sticky!important;
  left:0!important;
  width:var(--quick-view-sticky-width)!important;
  min-width:var(--quick-view-sticky-width)!important;
  max-width:var(--quick-view-sticky-width)!important;
  padding-left:8px!important;
  padding-right:8px!important;
  z-index:9;
  background:#0b0a08;
}
table[data-smart-columns-ready="1"][data-quick-view-ready="1"] th.quick-view-trigger-head{
  z-index:12;
  background:#17130c;
}
table[data-smart-columns-ready="1"] th.table-sticky-key,
table[data-smart-columns-ready="1"] td.table-sticky-key{
  position:sticky!important;
  left:0!important;
  z-index:8;
  background:#0b0a08;
  background-clip:padding-box;
  box-shadow:8px 0 12px -12px rgba(0,0,0,.92);
}
table[data-smart-columns-ready="1"][data-quick-view-ready="1"] th.table-sticky-key,
table[data-smart-columns-ready="1"][data-quick-view-ready="1"] td.table-sticky-key{
  left:var(--quick-view-sticky-width)!important;
}
table[data-smart-columns-ready="1"] th.table-sticky-key{
  z-index:11;
  background:#17130c;
}
table[data-smart-columns-ready="1"] tbody tr:nth-child(even) td.table-sticky-key,
table[data-smart-columns-ready="1"] tbody tr:nth-child(even) td.quick-view-trigger-cell{background:#0d0b08}
table[data-smart-columns-ready="1"] tbody tr:hover td.table-sticky-key,
table[data-smart-columns-ready="1"] tbody tr:hover td.quick-view-trigger-cell{background:#181207}

@media(max-width:900px){
  :root{--table-row-pad-y:6px;--table-row-pad-x:6px;--table-font-size:12.5px}
  .column-control-summary{display:none}
  .column-control-bar{justify-content:flex-end!important}
}
