/* Desktop UI overrides for stable sidebar footer and direct data tables. Mobile stays untouched. */
@media (min-width: 1024px){
  body.jg-desktop-shell .topbar{
    display:flex;
    flex-direction:column;
    overflow:hidden;
    padding-bottom:18px;
  }

  body.jg-desktop-shell #mainTabs{
    flex:1 1 auto;
    min-height:0;
    overflow:auto;
    padding-bottom:16px;
  }

  body.jg-desktop-shell #tabs{
    flex:0 0 auto;
  }

  body.jg-desktop-shell .topbar > #tabs:not(.jg-workflow-subnav){
    display:none!important;
  }

  body.jg-desktop-shell .jg-workflow-tabs-proxy{
    position:static!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:5px!important;
    margin:4px 0 8px 32px!important;
    padding:0!important;
    border:0!important;
    overflow:visible!important;
  }

  body.jg-desktop-shell .jg-workflow-tabs-proxy .tab{
    width:100%;
  }

  body.jg-desktop-shell .jg-sidebar-profile{
    position:static;
    flex:0 0 auto;
    width:auto;
    margin-top:14px;
    padding:12px;
    border-radius:14px;
    background:#111c2f;
    border:1px solid rgba(148,163,184,.18);
    box-shadow:0 12px 30px rgba(0,0,0,.18);
    z-index:auto;
  }

  body.jg-desktop-shell .jg-sidebar-profile .profile-role{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  body.jg-desktop-shell .jg-data-table[data-jg-real-table="1"]{
    width:100%;
  }

  body.jg-desktop-shell .jg-data-table[data-jg-real-table="1"] .actions,
  body.jg-desktop-shell .jg-data-table[data-jg-real-table="1"] .jg-table-actions{
    margin-top:0!important;
  }

  body.jg-desktop-shell .jg-table-cell > span{
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  body.jg-desktop-shell .jg-offer-table .jg-table-head,
  body.jg-desktop-shell .jg-offer-table .jg-table-row,
  body.jg-desktop-shell .jg-invoice-table .jg-table-head,
  body.jg-desktop-shell .jg-invoice-table .jg-table-row{
    grid-template-columns:minmax(170px,1.05fr) minmax(230px,1.6fr) minmax(90px,.55fr) minmax(130px,.72fr) minmax(260px,1.4fr);
  }

  body.jg-desktop-shell .jg-inspection-table .jg-table-head,
  body.jg-desktop-shell .jg-inspection-table .jg-table-row{
    grid-template-columns:minmax(180px,1fr) minmax(220px,1.2fr) minmax(260px,1.35fr) minmax(260px,1.25fr);
  }

  body.jg-desktop-shell .jg-customers-table .jg-table-head,
  body.jg-desktop-shell .jg-customers-table .jg-table-row{
    grid-template-columns:minmax(190px,1.05fr) minmax(220px,1.05fr) minmax(300px,1.6fr) minmax(260px,1.15fr);
  }

  body.jg-desktop-shell .jg-settings-company-table .jg-table-head,
  body.jg-desktop-shell .jg-settings-company-table .jg-table-row{
    grid-template-columns:minmax(170px,1.1fr) minmax(140px,.9fr) minmax(120px,.65fr) minmax(220px,1.25fr) minmax(240px,1.35fr) minmax(160px,.75fr);
  }

  body.jg-desktop-shell .jg-settings-backup-table .jg-table-head,
  body.jg-desktop-shell .jg-settings-backup-table .jg-table-row{
    grid-template-columns:minmax(300px,1.6fr) minmax(220px,1fr) minmax(180px,.75fr);
  }

  body.jg-desktop-shell .jg-settings-audit-table .jg-table-head,
  body.jg-desktop-shell .jg-settings-audit-table .jg-table-row{
    grid-template-columns:minmax(190px,1fr) minmax(230px,1.15fr) minmax(360px,1.85fr) minmax(150px,.7fr);
  }

  body.jg-desktop-shell .jg-settings-table-list{
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    display:block!important;
    overflow:visible!important;
  }

  body.jg-desktop-shell .jg-settings-company-table textarea{
    min-height:44px;
    max-height:82px;
    resize:vertical;
  }

  body.jg-desktop-shell .jg-settings-company-table .jg-table-row{
    min-height:78px;
  }

  body.jg-desktop-shell .jg-settings-audit-table .jg-table-row{
    min-height:58px;
  }

  body.jg-desktop-shell .jg-settings-audit-table .jg-table-cell:nth-child(3) > span{
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    line-height:1.35;
  }

  body.jg-desktop-shell .jg-table-cell[data-label="Status ändern"]{
    align-items:flex-start;
  }

  body.jg-desktop-shell .jg-table-cell[data-label="Status ändern"] select,
  body.jg-desktop-shell .jg-table-cell .jg-status-select{
    width:100%;
    max-width:128px;
  }

  body.jg-desktop-shell .jg-table-cell[data-label="Aktionen"]{
    align-items:stretch;
  }

  body.jg-desktop-shell .jg-offer-table .jg-table-head > div:last-child,
  body.jg-desktop-shell .jg-invoice-table .jg-table-head > div:last-child,
  body.jg-desktop-shell .jg-inspection-table .jg-table-head > div:last-child,
  body.jg-desktop-shell .jg-customers-table .jg-table-head > div:last-child,
  body.jg-desktop-shell .jg-settings-company-table .jg-table-head > div:last-child,
  body.jg-desktop-shell .jg-settings-backup-table .jg-table-head > div:last-child{
    display:flex;
    align-items:center;
    justify-content:center;
    justify-self:stretch;
    text-align:center;
  }

  body.jg-desktop-shell .jg-offer-table .jg-table-cell[data-label="Aktionen"],
  body.jg-desktop-shell .jg-invoice-table .jg-table-cell[data-label="Aktionen"],
  body.jg-desktop-shell .jg-inspection-table .jg-table-cell[data-label="Aktionen"],
  body.jg-desktop-shell .jg-customers-table .jg-table-cell[data-label="Aktionen"],
  body.jg-desktop-shell .jg-settings-company-table .jg-table-cell[data-label="Aktionen"],
  body.jg-desktop-shell .jg-settings-backup-table .jg-table-cell[data-label="Aktionen"]{
    display:flex;
    align-items:center;
    justify-content:center;
  }

  body.jg-desktop-shell .jg-table-actions{
    width:100%;
    display:flex!important;
    justify-content:center!important;
    align-items:center;
    gap:8px;
  }

  body.jg-desktop-shell .jg-table-actions .btn{
    white-space:nowrap;
  }

  body.jg-desktop-shell .jg-archive-table .jg-table-cell:nth-child(3){
    font-weight:900;
    color:#0f172a;
  }
}
