/* ── CMB Data Editor – List & Table Layout ───────────────────────── */

.cmb-content {
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1a1a2e;
}

.cmb-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 24px 28px 28px;
  margin: 0 0 24px;
}

.cmb-card-form {
  padding-top: 8px;
}

.cmb-list-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 16px;
}

/* ── Toolbar ─────────────────────────────────────────────────────── */

.cmb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eef0f4;
}

.cmb-toolbar-left,
.cmb-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cmb-content .cmb-toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 280px;
  min-width: 220px;
  max-width: 100%;
  padding: 0 14px 0 12px;
  border: 1px solid #dde1e8;
  border-radius: 12px;
  background: #fafbfc;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cmb-content .cmb-toolbar-search:focus-within {
  border-color: #f3a316;
  box-shadow: 0 0 0 3px rgba(243, 163, 22, 0.12);
}

.cmb-content .cmb-toolbar-search-icon {
  flex-shrink: 0;
  color: #9aa3b2;
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 18px;
}

.cmb-content .cmb-toolbar-search-input,
.cmb-content .cmb-toolbar-search input[type="search"],
.cmb-content .cmb-toolbar-search input[type="text"] {
  flex: 1;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 10px 0;
  border: none;
  border-radius: 0;
  font-size: 0.9rem;
  background: transparent;
  color: #1a1a2e;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.cmb-content .cmb-toolbar-search-input::placeholder,
.cmb-content .cmb-toolbar-search input::placeholder {
  color: #9aa3b2;
  opacity: 1;
}

.cmb-content .cmb-toolbar-search-input::-webkit-search-decoration,
.cmb-content .cmb-toolbar-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.cmb-toolbar-search-form form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmb-toolbar-category {
  position: relative;
  display: flex;
  align-items: center;
}

.cmb-toolbar-category select {
  appearance: none;
  padding: 9px 36px 9px 14px;
  border: 1px solid #dde1e8;
  border-radius: 10px;
  font-size: 0.9rem;
  background: #fafbfc;
  color: #1a1a2e;
  min-width: 160px;
  cursor: pointer;
}

.cmb-toolbar-category .dashicons-arrow-down-alt2 {
  position: absolute;
  right: 10px;
  color: #9aa3b2;
  font-size: 16px;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* ── Buttons ─────────────────────────────────────────────────────── */

.cmb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.cmb-btn .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  margin: 0;
}

.cmb-btn-primary {
  background: #f3a316;
  color: #ffffff !important;
  border-color: #f3a316;
}

.cmb-btn-primary:hover {
  background: #e09410;
  color: #ffffff !important;
}

.cmb-btn-secondary {
  background: #ffffff;
  color: #1a1a2e !important;
  border-color: #dde1e8;
}

.cmb-btn-secondary:hover {
  background: #f5f6f8;
  color: #1a1a2e !important;
}

.cmb-btn-ghost {
  background: #ffffff;
  color: #4a5568 !important;
  border-color: #dde1e8;
}

.cmb-btn-ghost:hover {
  background: #f5f6f8;
}

.cmb-btn-danger {
  background: #ef4444;
  color: #ffffff !important;
  border-color: #ef4444;
}

.cmb-btn-danger:hover {
  background: #dc2626;
  color: #ffffff !important;
  border-color: #dc2626;
}

.cmb-btn-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f3a316;
  color: #ffffff !important;
  text-decoration: none;
  transition: background 0.15s;
}

.cmb-btn-edit:hover {
  background: #e09410;
  color: #ffffff !important;
}

.cmb-btn-edit .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  margin: 0;
}

/* Legacy button bar (forms / detail views) */
.cmb-button-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.cmb-button-bar .gb-button-wrapper {
  margin: 0;
}

.cmb-button {
  background-color: #f3a316 !important;
  color: #ffffff !important;
  padding: 9px 16px;
  border-radius: 10px;
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
}

.cmb-button:hover,
a.cmb-button:hover {
  background-color: #e09410 !important;
  color: #ffffff !important;
}

.cmb-content .back,
.cmb-content .delete,
.cmb-content .big,
.cmb-content .refresh,
.cmb-content .search {
  float: none;
}

/* ── Data Table ──────────────────────────────────────────────────── */

.cmb-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cmb-table,
#cmb-table {
  width: 100%;
  border-collapse: collapse;
  border: none;
  word-break: keep-all;
}

.cmb-table thead tr,
#cmb-table thead tr {
  background: #f7f8fa;
}

.cmb-table th,
#cmb-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa3b2;
  border: none;
  border-bottom: 1px solid #eef0f4;
  white-space: nowrap;
}

.cmb-table tbody tr,
#cmb-table tbody tr {
  border-bottom: 1px solid #eef0f4;
  transition: background 0.12s;
}

.cmb-table tbody tr:hover,
#cmb-table tbody tr:hover {
  background: #fafbfc;
}

.cmb-table tbody tr:last-child,
#cmb-table tbody tr:last-child {
  border-bottom: none;
}

.cmb-table td,
#cmb-table td {
  padding: 14px 16px;
  text-align: left;
  border: none;
  vertical-align: middle;
  font-size: 0.9rem;
  color: #4a5568;
  background: transparent;
}

.cmb-table-empty td {
  text-align: center;
  color: #9aa3b2;
  padding: 32px 16px;
}

.cmb-col-name,
.cmb-col-name .cmb-name-text,
.cmb-name-link {
  font-weight: 700;
  color: #1a1a2e !important;
}

.cmb-name-link {
  text-decoration: none;
}

.cmb-name-link:hover {
  color: #f3a316 !important;
}

/* Category badges */
.cmb-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.cmb-badge-spices { background: #fdecd8; color: #c45d12; }
.cmb-badge-oilseeds { background: #e8f4e0; color: #3d7a2e; }
.cmb-badge-dried { background: #fce4ec; color: #b71c4a; }
.cmb-badge-pulses { background: #e3f2fd; color: #1565c0; }
.cmb-badge-cereals { background: #e3f0fa; color: #1a5fa8; }
.cmb-badge-starch { background: #f3e5f5; color: #7b1fa2; }
.cmb-badge-sugar { background: #fff3e0; color: #e65100; }
.cmb-badge-nuts { background: #e8f5e9; color: #2e7d32; }
.cmb-badge-herbs { background: #e0f2f1; color: #00695c; }
.cmb-badge-default { background: #eef0f4; color: #4a5568; }
.cmb-badge-empty { background: transparent; color: #c5cad3; padding: 0; }

.cmb-col-action {
  text-align: right;
  width: 60px;
}

#cmb-table .gb-button-wrapper {
  display: inline-flex;
  margin: 0;
  float: none;
}

#cmb-table .outdated {
  background-color: #ff5252 !important;
  color: white !important;
  border-radius: 50%;
}

#cmb-table .buttons {
  padding: 0;
  text-align: right;
}

#cmb-table a span {
  margin-top: 0;
}

.cmb-quick-edit {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ── Forms & misc (preserved) ──────────────────────────────────── */

.cmb-content h2 {
  width: 100%;
}

.cmb-content .col {
  display: inline-grid;
  max-width: 530px;
  min-width: 310px;
  vertical-align: top;
}

.cmb-content .col.first {
  margin-right: 40px;
}

.cmb-content .file {
  display: block;
  color: #666666;
  background-color: #fafafa;
  border-color: #bfbfbf;
  border-radius: 10px;
  border: 1px solid;
  padding: 10px 15px;
  max-width: 100%;
  margin-bottom: 8px;
}

.cmb-content .file .type { font-weight: bold; }
.cmb-content .file .name { font-family: "Lucida Console", "Courier New", monospace; }
.cmb-content .file .description { font-style: italic; }
.cmb-content .file .left { width: 70%; float: left; }
.cmb-content .file .right { float: right; }
.cmb-content .file .right div { margin: 0 0 8px 8px; }
.file .cmb-button { margin: 0; }

.main-navigation .menu-bar-items .has-login-form { display: none; }
.main-navigation .menu-bar-items .has-login-form .button { border: 1px solid white; }
.main-navigation ul ul.sub-menu { background-color: rgba(255, 255, 255, 0); }

.has-login-form.cmb-button p { display: grid; }
.has-login-form.cmb-button {
  position: absolute;
  top: 50px;
  right: 0px;
  margin-right: 0px;
}
.has-login-form.cmb-button input { border-radius: 10px; }

.green { background-color: #0c855d !important; }

.success {
  background-color: #0c855d;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
  color: #fff;
}

.error, .info {
  display: inline-block;
  background-color: #ff5252;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 8px 8px 8px 0;
  color: white;
  width: fit-content;
}

.info { background-color: #f3a316; }

.error span, .success span, .info span { margin: 3px 5px 0 0; }
.error.fullsize, .info.fullsize { margin-right: 0; width: auto; display: block; }
.inline-block .error { position: absolute; margin-top: 0; }

/* ── Form layout ─────────────────────────────────────────────────── */

.cmb-form-toolbar {
  margin-bottom: 20px;
}

.cmb-form-toolbar .cmb-button-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: none;
}

.cmb-form-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .cmb-form-split {
    grid-template-columns: 1fr;
  }
}

.cmb-form-header {
  margin-bottom: 24px;
}

.cmb-form-header .cmb-form-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 8px;
}

.cmb-form-subtitle,
.cmb-form-hint,
.cmb-import-hint {
  color: #6b7280;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 20px;
}

.cmb-form-layout .cmb-form-hint {
  padding: 0 2px;
}

.cmb-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 24px;
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .cmb-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .cmb-form-grid {
    grid-template-columns: 1fr;
  }
}

.cmb-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cmb-form-field-full {
  grid-column: 1 / -1;
}

.cmb-form-field-span-2 {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .cmb-form-field-span-2 {
    grid-column: span 1;
  }
}

.cmb-form-field-hidden {
  display: none;
}

.cmb-form-field > label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
}

.cmb-required {
  color: #ef4444;
  margin-left: 2px;
}

.cmb-form-control {
  position: relative;
}

.cmb-form-layout input[type="text"],
.cmb-form-layout input[type="number"],
.cmb-form-layout input[type="date"],
.cmb-form-layout input[type="datetime-local"],
.cmb-form-layout input[type="email"],
.cmb-form-layout input[type="password"],
.cmb-form-layout input[type="file"],
.cmb-form-layout select,
.cmb-form-layout textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #dde1e8;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #1a1a2e;
  background: #ffffff;
  min-height: 42px;
}

.cmb-form-layout select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa3b2' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.cmb-form-layout input[type="number"] {
  padding-right: 8px;
}

.cmb-form-layout textarea {
  min-height: 120px;
  resize: vertical;
}

.cmb-form-layout input:focus,
.cmb-form-layout select:focus,
.cmb-form-layout textarea:focus {
  outline: none;
  border-color: #f3a316;
  box-shadow: 0 0 0 3px rgba(243, 163, 22, 0.12);
}

.cmb-form-field-readonly input,
.cmb-form-field-readonly select,
.cmb-form-field-readonly textarea {
  background: #f9fafb;
  color: #6b7280;
}

.cmb-form-field-checkbox .cmb-form-control {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.cmb-form-field-checkbox input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin-top: 3px;
  flex-shrink: 0;
}

.cmb-form-field-checkbox label {
  font-weight: 400;
  font-size: 0.875rem;
}

.cmb-form-field-checkbox-group > label {
  margin-bottom: 4px;
}

.cmb-form-layout .checkbox-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
}

.cmb-form-layout .checkbox-group-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.cmb-form-layout .checkbox-group-item input[type="checkbox"] {
  width: auto;
  min-height: auto;
  margin-top: 2px;
  flex-shrink: 0;
}

.cmb-form-layout .checkbox-group-item label {
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .cmb-form-layout .checkbox-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .cmb-form-layout .checkbox-group {
    grid-template-columns: 1fr;
  }
}

.cmb-form-control .error {
  margin-top: 6px;
  font-size: 0.8rem;
}

.cmb-form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #eef0f4;
}

.cmb-form-footer-left,
.cmb-form-footer-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cmb-form-footer-right {
  margin-left: auto;
}

.cmb-form-footer .cmb-btn,
.cmb-form-toolbar .cmb-btn,
.cmb-button-bar .cmb-btn {
  min-width: 100px;
  justify-content: center;
}

.cmb-button-bar a span { margin: 0; }

.cmb-content .center { text-align: center; }
.cmb-content .clear { clear: both; margin-bottom: 2px; }
.cmb-content .inline-block { display: inline-block; }
.cmb-content .inline-grid { display: inline-grid; }

.cmb-form.small-inputs input { width: 100%; }
.cmb-form .hidden { display: none; }

/* ── CSV Import layout ───────────────────────────────────────────── */

.cmb-import-page .cmb-form-subtitle {
  margin-bottom: 24px;
}

.cmb-import-format {
  background: #f7f8fa;
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 24px;
}

.cmb-import-format-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 14px;
}

.cmb-import-format-columns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.cmb-import-format-sep {
  color: #9aa3b2;
  font-weight: 600;
  font-size: 0.95rem;
}

.cmb-import-col-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #dde1e8;
  border-radius: 999px;
  min-width: 0;
}

.cmb-import-col-pill-required {
  border-color: #f3a316;
  box-shadow: 0 0 0 1px rgba(243, 163, 22, 0.15);
}

.cmb-import-col-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1a1a2e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.cmb-import-col-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: #9aa3b2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cmb-import-col-pill-required .cmb-import-col-badge {
  color: #c45d12;
}

.cmb-import-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.cmb-import-rules li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  color: #4a5568;
  line-height: 1.4;
}

.cmb-import-rules .dashicons-yes-alt {
  color: #0c855d;
  font-size: 18px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.cmb-import-form .cmb-form-field-full textarea {
  min-height: 180px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.cmb-import-footer .cmb-import-status {
  font-size: 0.875rem;
  color: #9aa3b2;
}

.cmb-import-footer .cmb-import-status.cmb-import-status-ready {
  color: #0c855d;
  font-weight: 500;
}

.cmb-import-form button[name="save"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .cmb-import-rules {
    grid-template-columns: 1fr;
  }
}

.cmb-content .easy-autocomplete-container {
  left: -50px;
  width: 270px;
}

pre {
  background-color: black !important;
  color: white;
  font-family: Consolas, Menlo, "courier new", monospace !important;
}

.cmb-content .red-text { color: #ff5252; }
.cmb-content .red { color: #ff5252; }
.cmb-content .green-text { color: #0c855d; }
.cmb-content .flag { margin-right: 3px; }

.cmb-row-warning td { background: #fdf0f0 !important; }

/* ── Pagination ──────────────────────────────────────────────────── */

.cmb-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #eef0f4;
}

.cmb-pagination-info {
  font-size: 0.875rem;
  color: #6b7280;
}

.cmb-pagination-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.cmb-pagination-link,
.cmb-pagination-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.cmb-pagination-link {
  color: #4a5568 !important;
  background: #f7f8fa;
  border: 1px solid #eef0f4;
}

.cmb-pagination-link:hover {
  background: #eef0f4;
  color: #1a1a2e !important;
}

.cmb-pagination-current {
  background: #f3a316;
  color: #ffffff;
}

.cmb-pagination-ellipsis {
  color: #9aa3b2;
  padding: 0 4px;
}

.cmb-pagination-nav .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .cmb-card { padding: 16px; }
  .cmb-toolbar { flex-direction: column; align-items: stretch; }
  .cmb-toolbar-left, .cmb-toolbar-right { width: 100%; }
  .cmb-content .cmb-toolbar-search { width: 100%; }
}

.cmb-broker-supplier {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 8px;
}
.cmb-broker-supplier-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.75rem;
}
.cmb-broker-supplier label {
  font-weight: 600;
  margin: 0;
}
.cmb-supplier-select {
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 420px;
}
.cmb-broker-banner {
  margin-top: 0.6rem;
  font-weight: 600;
}

.cmb-acting-as {
  display: inline-flex !important;
  align-items: center;
  margin-left: 8px;
  vertical-align: middle;
  align-self: center;
}

.main-navigation .menu-bar-items .cmb-acting-as,
.mobile-menu-control-wrapper .menu-bar-items .cmb-acting-as {
  display: inline-flex !important;
  height: 40px;
}

.cmb-acting-as-form {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.cmb-acting-as-select {
  max-width: 200px;
  min-width: 140px;
  height: 32px;
  font-size: 12px;
  line-height: 1.2;
  padding: 2px 8px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  background: #ffb81c;
  color: #fff;
  cursor: pointer;
  appearance: auto;
  -webkit-appearance: menulist;
}

.cmb-acting-as-select option {
  color: #1d2327;
  background: #fff;
}

.main-navigation .cmb-acting-as-select {
  color: #fff;
}

