
/* Phase 106 – real visual cleanup: remove nested frames and force responsive structure */
html.admin-ui-active{
  --admin106-bg:#07111f;
  --admin106-card:#102038;
  --admin106-card2:#0d1a2e;
  --admin106-table:#0c192c;
  --admin106-head:#12233b;
  --admin106-line:rgba(148,163,184,.10);
  --admin106-softline:rgba(148,163,184,.055);
  --admin106-text:#f8fbff;
  --admin106-muted:#a6b8cf;
}

/* The old CSS/JS left inline important styles. These selectors are intentionally very specific. */
html.admin-ui-active body.admin-shell-body .admin-content-v91 .surface-card.admin-frameless,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .admin-frameless,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .admin-frameless.table-shell,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .admin-frameless.table-responsive,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .admin-frameless.dataTables_wrapper{
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  background:transparent!important;
  background-color:transparent!important;
  padding:0!important;
}

/* Remove double borders from all nested surfaces inside a main surface. */
html.admin-ui-active body.admin-shell-body .admin-content-v91 .surface > .surface-card,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .surface > .card,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .surface > .panel,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .surface > .content-card,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .surface > .form-card{
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  background:transparent!important;
  background-color:transparent!important;
  padding:0!important;
}

/* Actual module cards keep a single subtle edge. */
html.admin-ui-active body.admin-shell-body .admin-content-v91 > :where(section,.section-grid) :where(.surface,.card,.panel,.module-card,.settings-card,.content-card,.form-card,.aside-stack > .surface){
  border:1px solid var(--admin106-line)!important;
  box-shadow:0 12px 32px rgba(0,0,0,.12)!important;
}

/* Section-grid should not squeeze detail pages. Stack earlier. */
html.admin-ui-active body.admin-shell-body .admin-content-v91 .section-grid{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(300px,380px)!important;
  gap:20px!important;
  align-items:start!important;
}
html.admin-ui-active body.admin-shell-body .admin-content-v91 .section-grid.admin-single-column,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .section-grid.domain-review-grid{
  grid-template-columns:minmax(0,1fr)!important;
}
html.admin-ui-active body.admin-shell-body .admin-content-v91 .domain-review-grid .aside-stack{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr))!important;
  gap:18px!important;
}

/* Tables: wrapper has no border; table owns the only boundary. */
html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(.table-shell,.admin-readable-table-shell,.table-responsive,.dataTables_wrapper,.dataTables_scroll,.dataTables_scrollHead,.dataTables_scrollBody){
  border:0!important;
  outline:0!important;
  box-shadow:none!important;
  background:transparent!important;
  background-color:transparent!important;
  padding:0!important;
  margin:0!important;
}
html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table,.table,table.dataTable,.admin-readable-table){
  border:1px solid var(--admin106-line)!important;
  border-radius:14px!important;
  overflow:hidden!important;
  box-shadow:none!important;
  background:var(--admin106-table)!important;
  background-color:var(--admin106-table)!important;
  width:100%!important;
  min-width:0!important;
}
html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table thead th,.table thead th,table.dataTable thead th){
  border-bottom:1px solid var(--admin106-line)!important;
  background:var(--admin106-head)!important;
  background-color:var(--admin106-head)!important;
}
html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table tbody td,.table tbody td,table.dataTable tbody td){
  border-bottom:1px solid var(--admin106-softline)!important;
}
html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table tbody tr:last-child td,.table tbody tr:last-child td,table.dataTable tbody tr:last-child td){
  border-bottom:0!important;
}

/* No nested scrollbar frame unless the table truly overflows. */
html.admin-ui-active body.admin-shell-body .admin-content-v91 .admin-readable-table-shell{
  overflow-x:auto!important;
  overflow-y:visible!important;
  -webkit-overflow-scrolling:touch!important;
}
html.admin-ui-active body.admin-shell-body .admin-content-v91 .admin-readable-table-shell::-webkit-scrollbar,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .table-shell::-webkit-scrollbar{
  height:6px!important;
}
html.admin-ui-active body.admin-shell-body .admin-content-v91 .admin-readable-table-shell::-webkit-scrollbar-track,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .table-shell::-webkit-scrollbar-track{
  background:transparent!important;
}
html.admin-ui-active body.admin-shell-body .admin-content-v91 .admin-readable-table-shell::-webkit-scrollbar-thumb,
html.admin-ui-active body.admin-shell-body .admin-content-v91 .table-shell::-webkit-scrollbar-thumb{
  background:rgba(148,163,184,.25)!important;
  border-radius:999px!important;
}

/* Detail/summary lists should not look like boxed tables. */
html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(.summary-list,.description-list,.details-list){
  border:0!important;
  box-shadow:none!important;
  background:transparent!important;
  display:grid!important;
  gap:0!important;
}
html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(.summary-list > div,.description-list > div,.details-list > div){
  border:0!important;
  border-bottom:1px solid var(--admin106-softline)!important;
  border-radius:0!important;
  background:transparent!important;
  padding:12px 0!important;
}
html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(.summary-list > div:last-child,.description-list > div:last-child,.details-list > div:last-child){
  border-bottom:0!important;
}

/* Mobile admin controls should not float in the middle of the page. */
html.admin-ui-active .admin-mobile-bar{
  width:100%!important;
  max-width:100%!important;
}
@media (max-width: 991.98px){
  html.admin-ui-active .admin-mobile-bar{
    position:sticky!important;
    top:0!important;
    z-index:1100!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:10px!important;
    padding:12px!important;
    background:#07111f!important;
    border-bottom:1px solid var(--admin106-line)!important;
  }
  html.admin-ui-active .admin-mobile-bar .btn,
  html.admin-ui-active .admin-mobile-bar select{
    width:100%!important;
  }
  html.admin-ui-active body.admin-shell-body .admin-content-v91{
    padding:14px!important;
  }
}

/* Stack split layouts before they become squeezed. */
@media (max-width: 1500px){
  html.admin-ui-active body.admin-shell-body .admin-content-v91 .section-grid{
    grid-template-columns:1fr!important;
  }
  html.admin-ui-active body.admin-shell-body .admin-content-v91 .aside-stack{
    display:grid!important;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr))!important;
    gap:18px!important;
  }
}

/* Small screens: cards instead of cramped tables. */
@media (max-width: 767.98px){
  html.admin-ui-active body.admin-shell-body .admin-content-v91{
    padding:12px!important;
  }
  html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(.surface,.card,.panel,.module-card,.workspace-hero){
    border-radius:18px!important;
  }
  html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table,.table,table.dataTable,.admin-readable-table){
    border:0!important;
    background:transparent!important;
  }
  html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table:not(.no-mobile-cards),.table:not(.no-mobile-cards),.admin-readable-table:not(.no-mobile-cards)) thead{
    display:none!important;
  }
  html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table:not(.no-mobile-cards),.table:not(.no-mobile-cards),.admin-readable-table:not(.no-mobile-cards)),
  html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table:not(.no-mobile-cards),.table:not(.no-mobile-cards),.admin-readable-table:not(.no-mobile-cards)) tbody,
  html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table:not(.no-mobile-cards),.table:not(.no-mobile-cards),.admin-readable-table:not(.no-mobile-cards)) tr,
  html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table:not(.no-mobile-cards),.table:not(.no-mobile-cards),.admin-readable-table:not(.no-mobile-cards)) td{
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }
  html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table:not(.no-mobile-cards),.table:not(.no-mobile-cards),.admin-readable-table:not(.no-mobile-cards)) tr{
    border:1px solid var(--admin106-line)!important;
    border-radius:16px!important;
    margin:0 0 12px!important;
    overflow:hidden!important;
    background:var(--admin106-table)!important;
  }
  html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table:not(.no-mobile-cards),.table:not(.no-mobile-cards),.admin-readable-table:not(.no-mobile-cards)) td{
    display:flex!important;
    justify-content:space-between!important;
    align-items:flex-start!important;
    gap:12px!important;
    padding:12px 14px!important;
    border-bottom:1px solid var(--admin106-softline)!important;
    text-align:right!important;
  }
  html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table:not(.no-mobile-cards),.table:not(.no-mobile-cards),.admin-readable-table:not(.no-mobile-cards)) td::before{
    content:attr(data-label)!important;
    flex:0 0 44%!important;
    max-width:44%!important;
    text-align:left!important;
    color:#fff!important;
    font-weight:850!important;
  }
  html.admin-ui-active body.admin-shell-body .admin-content-v91 :where(table:not(.no-mobile-cards),.table:not(.no-mobile-cards),.admin-readable-table:not(.no-mobile-cards)) td:last-child{
    border-bottom:0!important;
  }
}
