/* Phase 105 – admin responsive polish and border cleanup */
html.admin-ui-active{
  --admin105-line: rgba(148,163,184,.11);
  --admin105-line-soft: rgba(148,163,184,.07);
  --admin105-panel: #0f1d31;
  --admin105-panel-2: #102038;
}

/* Hard-stop horizontal bleed */
html.admin-ui-active,
html.admin-ui-active body.admin-shell-body,
html.admin-ui-active .main-container,
html.admin-ui-active .page-content,
html.admin-ui-active .admin-app-v91,
html.admin-ui-active .admin-app-v91__workspace,
html.admin-ui-active .admin-content-v91{
  max-width:100% !important;
  overflow-x:hidden !important;
}

/* Cleaner vertical rhythm */
html.admin-ui-active .admin-content-v91{
  padding:22px !important;
}
html.admin-ui-active .admin-content-v91 :where(.workspace-hero,.admin-module-hero,.surface,.surface-muted,.card,.panel,.module-card,.content-card){
  border-radius:24px !important;
}

/* Remove extra frames inside primary module cards */
html.admin-ui-active .admin-content-v91 :where(.surface,.card,.panel,.module-card,.content-card) > :where(.surface-card,.surface-muted,.content-card,.form-card){
  border:0 !important;
  box-shadow:none !important;
  background:transparent !important;
}

/* Nested cards that only hold tables/forms should not create extra borders */
html.admin-ui-active .admin-content-v91 :where(.surface-card,.content-card,.form-card){
  border-color:transparent !important;
  box-shadow:none !important;
}
html.admin-ui-active .admin-content-v91 :where(.surface-card,.content-card,.form-card) > :where(.table-shell,.admin-readable-table-shell,.table-responsive,.dataTables_wrapper,.dataTables_scroll,.dataTables_scrollBody){
  margin-top:0 !important;
}

/* Single clean table frame only */
html.admin-ui-active .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;
  padding:0 !important;
}
html.admin-ui-active .admin-content-v91 :where(table,.table,table.dataTable,.admin-readable-table){
  width:100% !important;
  border:1px solid var(--admin105-line) !important;
  border-radius:16px !important;
  overflow:hidden !important;
  box-shadow:none !important;
  background:#0b1728 !important;
}
html.admin-ui-active .admin-content-v91 :where(table thead th,.table thead th,table.dataTable thead th,.admin-readable-table thead th){
  background:#12233b !important;
  color:#f8fbff !important;
  border-bottom:1px solid var(--admin105-line) !important;
}
html.admin-ui-active .admin-content-v91 :where(table tbody tr,table tbody td,.table tbody tr,.table tbody td,table.dataTable tbody tr,table.dataTable tbody td){
  background:#0c192c !important;
}
html.admin-ui-active .admin-content-v91 :where(table tbody td,.table tbody td,table.dataTable tbody td,.admin-readable-table tbody td){
  border-bottom:1px solid var(--admin105-line-soft) !important;
}
html.admin-ui-active .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;
}

/* Soften summary/detail lines */
html.admin-ui-active .admin-content-v91 :where(.summary-list,.description-list,.details-list){
  border:0 !important;
  background:transparent !important;
}
html.admin-ui-active .admin-content-v91 :where(.summary-list > div,.description-list > div,.details-list > div){
  border-bottom:1px solid var(--admin105-line-soft) !important;
  padding:12px 0 !important;
}
html.admin-ui-active .admin-content-v91 :where(.summary-list > div:last-child,.description-list > div:last-child,.details-list > div:last-child){
  border-bottom:0 !important;
}

/* Cleaner headers and toolbars */
html.admin-ui-active .admin-content-v91 :where(.surface-head,.module-header,.admin-section-header,.workspace-hero){
  box-shadow:none !important;
}
html.admin-ui-active .admin-content-v91 :where(.surface-head,.module-header,.admin-section-header){
  border-bottom:1px solid var(--admin105-line-soft) !important;
  padding-bottom:14px !important;
  margin-bottom:14px !important;
}

/* Forms and side cards */
html.admin-ui-active .admin-content-v91 :where(.form-control,.form-select,textarea){
  border-color:rgba(148,163,184,.16) !important;
}
html.admin-ui-active .admin-content-v91 textarea.form-control{
  min-height:120px !important;
}
html.admin-ui-active .admin-content-v91 .aside-stack{
  gap:16px !important;
}

/* Medium screens should stack content earlier */
@media (max-width: 1199.98px){
  html.admin-ui-active .admin-content-v91 :where(.section-grid,.section-grid--balanced,.panel-grid-v67,.admin-grid-v90){
    grid-template-columns:1fr !important;
  }
  html.admin-ui-active .admin-content-v91 .workspace-hero{
    gap:16px !important;
  }
  html.admin-ui-active .admin-content-v91 .workspace-hero__actions{
    width:100% !important;
  }
  html.admin-ui-active .admin-content-v91 .workspace-hero__actions .btn{
    width:100% !important;
  }
  html.admin-ui-active .admin-content-v91 :where(.checkout-grid,.form-grid-2,.grid-2-col){
    grid-template-columns:1fr !important;
  }
}

/* Tablet/mobile shell */
@media (max-width: 991.98px){
  html.admin-ui-active .admin-mobile-bar{
    display:grid !important;
    grid-template-columns:minmax(160px,210px) minmax(0,1fr) !important;
    align-items:center !important;
    gap:10px !important;
    padding:12px !important;
    background:#07111f !important;
    border-bottom:1px solid var(--admin105-line) !important;
  }
  html.admin-ui-active .admin-mobile-bar > *{min-width:0 !important;}
  html.admin-ui-active .admin-sidebar-toggle,
  html.admin-ui-active .admin-mobile-jump{
    width:100% !important;
    min-height:48px !important;
  }
  html.admin-ui-active .admin-topbar-v91{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px !important;
    padding:14px !important;
  }
  html.admin-ui-active .admin-topbar-v91__actions{
    grid-column:auto !important;
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:10px !important;
  }
  html.admin-ui-active .admin-content-v91{
    padding:16px !important;
  }
}

/* Mobile card/table conversion without double borders */
@media (max-width: 767.98px){
  html.admin-ui-active .admin-mobile-bar{grid-template-columns:1fr !important;}
  html.admin-ui-active .admin-content-v91{padding:14px !important;}
  html.admin-ui-active .admin-content-v91 :where(.workspace-hero,.surface,.surface-muted,.card,.panel,.module-card,.content-card){
    border-radius:18px !important;
  }
  html.admin-ui-active .admin-content-v91 :where(.table-shell,.admin-readable-table-shell,.table-responsive,.dataTables_wrapper,.dataTables_scroll,.dataTables_scrollBody){
    border:0 !important;
    background:transparent !important;
    padding:0 !important;
    box-shadow:none !important;
  }
  html.admin-ui-active .admin-content-v91 :where(table,.table,table.dataTable,.admin-readable-table){
    border:0 !important;
    background:transparent !important;
  }
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) thead,
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) thead{display:none !important;}
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards),
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) tbody,
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) tr,
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) td,
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards),
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) tbody,
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) tr,
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) td{
    display:block !important;
    width:100% !important;
    min-width:0 !important;
  }
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) tr,
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) tr{
    margin:0 0 12px !important;
    border:1px solid var(--admin105-line) !important;
    border-radius:16px !important;
    overflow:hidden !important;
    background:#0c192c !important;
    box-shadow:none !important;
  }
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) td,
  html.admin-ui-active .admin-content-v91 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(--admin105-line-soft) !important;
    text-align:right !important;
    background:#0c192c !important;
  }
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) td::before,
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) td::before{
    content:attr(data-label) !important;
    color:#ffffff !important;
    font-weight:800 !important;
    text-align:left !important;
    max-width:46% !important;
    flex:0 0 46% !important;
  }
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) td:last-child,
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) td:last-child{
    border-bottom:0 !important;
  }
  html.admin-ui-active .admin-content-v91 .workspace-hero__actions,
  html.admin-ui-active .admin-content-v91 .admin-topbar-v91__actions{
    grid-template-columns:1fr !important;
  }
}

@media (max-width: 575.98px){
  html.admin-ui-active .admin-content-v91{padding:12px !important;}
  html.admin-ui-active .admin-content-v91 .workspace-hero__title,
  html.admin-ui-active .admin-topbar-v91__title h1{font-size:clamp(1.6rem,7vw,2rem) !important;}
}
