/*
 * ============================================================
 * Supply Chain Theme — WordPress Admin Dashboard
 * ============================================================
 * Matches the exact design of the Supply Chain Flow module.
 * ============================================================
*/

/* ──────────────────────────────────────────────────────────
   1. BASE — Global body & font
   ────────────────────────────────────────────────────────── */

body,
#wpwrap,
#wpbody,
#wpbody-content {
  background: #f3f4f6 !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 14px !important;
  color: #374151 !important;
}

/* ──────────────────────────────────────────────────────────
   2. TOP ADMIN BAR — #wpadminbar
   ────────────────────────────────────────────────────────── */

#wpadminbar {
  background: #ffffff !important;
  border-bottom: 1px solid #e5e7eb !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.05) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  padding: 0 24px !important;
}

#wpadminbar > #wp-toolbar {
  padding: 0 !important;
}

#wpadminbar .ab-item {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

#wpadminbar * {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

#wpadminbar .ab-item,
#wpadminbar .ab-label,
#wpadminbar a.ab-item,
#wpadminbar > #wp-toolbar > #wp-admin-bar-root-default .ab-item,
#wpadminbar > #wp-toolbar > #wp-admin-bar-top-secondary .ab-item {
  color: #374151 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}

#wpadminbar #wp-admin-bar-site-name > .ab-item,
#wpadminbar #wp-admin-bar-wp-logo > .ab-item {
  color: #111827 !important;
  font-weight: 600 !important;
}

#wpadminbar #wp-admin-bar-wp-logo .ab-icon:before,
#wpadminbar .ab-icon:before {
  color: #9ca3af !important;
  top: 2px;
}

#wpadminbar li:hover > .ab-item,
#wpadminbar li.hover > .ab-item,
#wpadminbar .ab-item:focus,
#wpadminbar a.ab-item:hover {
  background: transparent !important;
  color: #2563eb !important;
}

#wpadminbar .menupop .ab-sub-wrapper,
#wpadminbar .shortlink-input {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.1) !important;
  overflow: hidden;
  margin-top: 4px;
}

#wpadminbar .ab-submenu .ab-item {
  color: #374151 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
}

#wpadminbar .ab-submenu li:hover > .ab-item,
#wpadminbar .ab-submenu li.hover > .ab-item {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

#wpadminbar #wp-admin-bar-my-account .ab-item {
  color: #374151 !important;
  font-weight: 500 !important;
}

#wpadminbar .update-plugins .ab-label,
#wpadminbar .awaiting-mod .ab-label {
  background: #2563eb !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  min-width: 18px;
  text-align: center;
}

/* ──────────────────────────────────────────────────────────
   3. SIDEBAR / ADMIN MENU — #adminmenu
   ────────────────────────────────────────────────────────── */

#adminmenuback,
#adminmenuwrap,
#adminmenu {
  background: #ffffff !important;
  border-right: 1px solid #e5e7eb !important;
  box-shadow: 1px 0 4px rgba(0,0,0,.04) !important;
}

#adminmenu li > a,
#adminmenu li.menu-top > a {
  color: #4b5563 !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 8px 12px !important;
  border-radius: 8px !important;
  margin: 1px 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  transition: background .15s, color .15s !important;
}

#adminmenu li > a:hover,
#adminmenu li.menu-top > a:hover,
#adminmenu .wp-submenu li > a:hover {
  background: #f9fafb !important;
  color: #1f2937 !important;
}

#adminmenu .current > a,
#adminmenu li.wp-has-current-submenu > a,
#adminmenu li.menu-top.current > a {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 600 !important;
}

#adminmenu li div.wp-menu-image:before {
  color: #9ca3af !important;
  font-size: 18px !important;
}

#adminmenu .current div.wp-menu-image:before,
#adminmenu li.wp-has-current-submenu div.wp-menu-image:before {
  color: #2563eb !important;
}

#adminmenu .wp-submenu {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.08) !important;
  padding: 4px !important;
  margin-left: 8px !important;
}

#adminmenu .wp-submenu li > a {
  color: #4b5563 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  padding: 7px 12px !important;
  border-radius: 6px !important;
}

#adminmenu .wp-submenu .current > a {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 600 !important;
}

/* ──────────────────────────────────────────────────────────
   4. MAIN CONTENT AREA
   ────────────────────────────────────────────────────────── */

#wpcontent,
.wrap {
  background: #f3f4f6 !important;
}

.wrap h1,
.wrap h1.wp-heading-inline {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #111827 !important;
}

/* ──────────────────────────────────────────────────────────
   5. METABOXES / POSTBOXES (cards)
   ────────────────────────────────────────────────────────── */

.postbox {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.05) !important;
  overflow: hidden;
}

.postbox .postbox-header {
  background: #ffffff !important;
  border-bottom: 1px solid #f3f4f6 !important;
  padding: 14px 20px !important;
}

/* ──────────────────────────────────────────────────────────
   6. BUTTONS
   ────────────────────────────────────────────────────────── */

.wp-core-ui .button-primary {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  padding: 10px 32px !important;
  height: auto !important;
  line-height: 1.4 !important;
}

.wp-core-ui .button-primary:hover {
  background: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
}

/* ──────────────────────────────────────────────────────────
   7. FORM INPUTS
   ────────────────────────────────────────────────────────── */

input[type="text"],
input[type="search"],
select,
textarea {
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  background: #ffffff !important;
}

/* ──────────────────────────────────────────────────────────
   8. TABLES
   ────────────────────────────────────────────────────────── */

.wp-list-table {
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

.wp-list-table thead th {
  background: #2563eb !important;
  color: #ffffff !important;
  font-size: 11px !important;
  text-transform: uppercase;
}

/* ──────────────────────────────────────────────────────────
   9. EDITOR FIXES (Crucial for Edit Page Visibility)
   ────────────────────────────────────────────────────────── */

/* Ensure the classic editor and text areas are white, not grey */
#postdivrich, 
.wp-editor-container, 
#wp-content-editor-container, 
.mce-edit-area iframe,
.block-editor-writing-flow {
  background: #ffffff !important;
  color: #374151 !important;
}

/* SiteOrigin Page Builder row visibility */
.so-panel.panel-has-style {
  background-color: #ffffff !important;
}

/* Prevent the global background from hiding the visual editor tools */
#wp-link-wrap, 
.mce-window, 
.mce-floatpanel {
  background: #ffffff !important;
  z-index: 100101 !important;
}

/* Fix text color in editor when using Dark/Grey Admin themes */
.wp-editor-area {
  color: #111827 !important;
  background: #ffffff !important;
}

/* ──────────────────────────────────────────────────────────
   10. UTILITY / REMOVE DEFAULTS
   ────────────────────────────────────────────────────────── */

/* Remove Default Spacing for IFRAME app display */
.wp-site-blocks, 
main.wp-block-group, 
.entry-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Hide featured image on single pages per your request */
.page .wp-post-image, 
.page .post-thumbnail {
  display: none !important;
}

/* Clean scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f3f4f6; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 999px; }