/* Phase 104 – admin visual refinement
   Goal: remove unnecessary borders, reduce visual noise, and improve spacing consistency. */
html.admin-ui-active {
  --admin104-line: rgba(148,163,184,.12);
  --admin104-line-soft: rgba(148,163,184,.08);
  --admin104-line-none: rgba(148,163,184,.04);
  --admin104-shadow: 0 16px 40px rgba(0,0,0,.14);
  --admin104-shadow-soft: 0 10px 28px rgba(0,0,0,.10);
}

/* Make the workspace breathe a bit more */
html.admin-ui-active .admin-content-v91{
  padding:24px !important;
}
html.admin-ui-active .admin-content-v91 :where(.metric-grid,.section-grid,.admin-dashboard-grid,.stats-grid,.surface-grid){
  gap:18px !important;
}

/* Tone down borders on major shells */
html.admin-ui-active .admin-content-v91 :where(.surface,.surface-card,.surface-muted,.card,.panel,.module-card,.settings-card,.content-card,.form-card,.accordion-item,.modal-content,.workspace-hero,.admin-module-hero,.admin-hero-v95,.module-hero,.page-hero){
  border:1px solid var(--admin104-line) !important;
  box-shadow:var(--admin104-shadow) !important;
}

/* Remove stacked/nested frames inside cards */
html.admin-ui-active .admin-content-v91 :where(.surface,.card,.module-card,.panel) :where(.surface,.surface-card,.surface-muted,.card,.panel,.content-card,.form-card,.table-shell,.table-responsive,.dataTables_wrapper,.dataTables_scroll,.dataTables_scrollBody,.admin-table-scroll-v95){
  border-color:transparent !important;
  box-shadow:none !important;
}

/* Use one clean wrapper around tables instead of 3-4 outlines */
html.admin-ui-active .admin-content-v91 :where(.table-shell,.admin-readable-table-shell,.table-responsive,.dataTables_wrapper,.dataTables_scroll,.dataTables_scrollHead,.dataTables_scrollBody,.admin-table-scroll-v95){
  border:0 !important;
  box-shadow:none !important;
  background:transparent !important;
  padding:0 !important;
}

html.admin-ui-active .admin-content-v91 .surface .table-shell,
html.admin-ui-active .admin-content-v91 .surface .table-responsive,
html.admin-ui-active .admin-content-v91 .surface .dataTables_wrapper,
html.admin-ui-active .admin-content-v91 .surface .dataTables_scroll,
html.admin-ui-active .admin-content-v91 .surface .dataTables_scrollBody{
  margin-top:10px !important;
}

/* One neat border around actual tables */
html.admin-ui-active .admin-content-v91 :where(table,.table,table.dataTable,.admin-readable-table){
  border:1px solid var(--admin104-line) !important;
  border-radius:16px !important;
  overflow:hidden !important;
  box-shadow:none !important;
}
html.admin-ui-active .admin-content-v91 :where(table thead th,.table thead th,table.dataTable thead th,.admin-readable-table thead th){
  border-bottom:1px solid var(--admin104-line) !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-top:0 !important;
  border-bottom:1px solid var(--admin104-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,.admin-readable-table tbody tr:last-child td){
  border-bottom:0 !important;
}

/* Cleaner section headings */
html.admin-ui-active .admin-content-v91 :where(.surface-head,.module-header,.admin-section-header,.card-header){
  border-bottom:1px solid var(--admin104-line-soft) !important;
  box-shadow:none !important;
  background:transparent !important;
  padding-bottom:14px !important;
  margin-bottom:14px !important;
}
html.admin-ui-active .admin-content-v91 :where(hr,.divider,.section-divider){
  border-color:var(--admin104-line-soft) !important;
  opacity:1 !important;
}

/* Buttons cleaner */
html.admin-ui-active .admin-content-v91 :where(.btn,.btn-surface,.btn-light,.btn-outline-secondary,.btn-ghost){
  border-color:rgba(148,163,184,.18) !important;
  box-shadow:none !important;
}
html.admin-ui-active .admin-content-v91 :where(.btn-primary,.btn-success,.btn-ready,.btn-brand){
  box-shadow:0 8px 22px rgba(37,99,235,.24) !important;
}

/* Metric/stat cards should look simpler */
html.admin-ui-active .admin-content-v91 :where(.metric-card,.metric-card-v95,.stat-card,.dashboard-stat,.mini-stat,.kpi-card){
  border:1px solid var(--admin104-line) !important;
  box-shadow:var(--admin104-shadow-soft) !important;
}
html.admin-ui-active .admin-content-v91 :where(.metric-card,.metric-card-v95,.stat-card,.dashboard-stat,.mini-stat,.kpi-card) :where(.metric-icon,.stat-icon,.kpi-icon){
  border:0 !important;
  box-shadow:none !important;
  background:rgba(59,130,246,.12) !important;
}

/* Soften sidebar separators */
html.admin-ui-active .admin-sidebar,
html.admin-ui-active .admin-topbar-v91{
  border-color:var(--admin104-line) !important;
}
html.admin-ui-active .admin-sidebar :where(.admin-sidebar__header,.admin-sidebar__search,.admin-sidebar__footer,.admin-sidebar__section){
  border-color:var(--admin104-line-soft) !important;
}
html.admin-ui-active .admin-sidebar :where(.admin-sidebar__link,.sidebar-link,.nav-link){
  border:1px solid transparent !important;
}
html.admin-ui-active .admin-sidebar :where(.admin-sidebar__link.is-active,.sidebar-link.active,.nav-link.active){
  border-color:rgba(96,165,250,.22) !important;
  box-shadow:none !important;
}

/* Forms – no extra frames */
html.admin-ui-active .admin-content-v91 :where(.form-grid-2,.form-grid-3,.input-group,.filters-row,.toolbar-row){
  border:0 !important;
  box-shadow:none !important;
}
html.admin-ui-active .admin-content-v91 :where(input,select,textarea,.form-control,.form-select,.custom-select){
  box-shadow:none !important;
}

/* Mobile refinement */
@media (max-width: 767.98px){
  html.admin-ui-active .admin-content-v91{ padding:16px !important; }
  html.admin-ui-active .admin-content-v91 :where(.surface,.card,.module-card,.workspace-hero,.admin-module-hero){
    border-radius:18px !important;
  }
  html.admin-ui-active .admin-content-v91 :where(table:not(.no-mobile-cards) tr,.table:not(.no-mobile-cards) tr){
    border:1px solid var(--admin104-line) !important;
    box-shadow:none !important;
  }
  html.admin-ui-active .admin-content-v91 :where(table:not(.no-mobile-cards) td,.table:not(.no-mobile-cards) td){
    border-bottom:1px solid var(--admin104-line-soft) !important;
  }
}
