/* CBX Bultos Pro - Modern Admin UI (v2.1) */

.cbxb-wrap { max-width: 1200px; }

/* Small helper for the inline buttons we render inside the WooCommerce order screen */
.cbxb-inline-buttons{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  margin:12px 0 0;
  clear:both;
  width:100%;
}
.cbxb-inline-buttons .button{
  margin:0;
}

/* Root / tokens */
.cbxb-app-root{
  --cbx-bg:#f5f7fb;
  --cbx-card:#ffffff;
  --cbx-border:#e2e8f0;
  --cbx-text:#0f172a;
  --cbx-muted:#64748b;
  --cbx-primary:#2563eb;
  --cbx-primary-2:#1d4ed8;
  --cbx-soft:#eff6ff;
  --cbx-soft-2:#dbeafe;
  --cbx-success:#16a34a;
  --cbx-warn:#f59e0b;
  --cbx-danger:#dc2626;
  --cbx-radius:14px;
  --cbx-shadow:0 18px 45px rgba(15,23,42,0.12);

  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  color: var(--cbx-text);
}

.cbxb-shell{
  background: var(--cbx-bg);
  border: 1px solid var(--cbx-border);
  border-radius: var(--cbx-radius);
  padding: 18px;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}

.cbxb-shell--modal{
  height: 100%;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 18px 18px 22px;
  background: var(--cbx-bg);
}

/* Top bar */
.cbxb-topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.cbxb-brand__title{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .2px;
  margin: 0 0 4px;
}

.cbxb-brand__sub{
  font-size: 13px;
  color: var(--cbx-muted);
}

.cbxb-orderbox{
  min-width: 420px;
  background: var(--cbx-card);
  border: 1px solid var(--cbx-border);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 20px rgba(15,23,42,.06);
}

.cbxb-orderbox__label{
  font-size: 12px;
  font-weight: 700;
  color: var(--cbx-muted);
  margin-bottom: 8px;
}

.cbxb-orderbox__row{
  display:flex;
  align-items:center;
  gap: 8px;
}

.cbxb-head-actions{
  display:flex;
  align-items:center;
  gap: 8px;
}

/* Inputs */
.cbxb-input{
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--cbx-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(15,23,42,.03);
}

.cbxb-input:focus{
  outline: none;
  border-color: var(--cbx-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.cbxb-input--order{ width: 130px; }
.cbxb-input--big{
  font-size: 16px;
  padding: 12px 12px;
  border-radius: 12px;
}

/* Buttons */
.cbxb-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  user-select: none;
  transition: transform .02s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.cbxb-btn:active{ transform: translateY(1px); }
.cbxb-btn .dashicons{ font-size: 16px; width: 16px; height: 16px; line-height: 16px; }

.cbxb-btn--primary{
  background: var(--cbx-primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37,99,235,.18);
}

.cbxb-btn--primary:hover{ background: var(--cbx-primary-2); color:#fff; }

.cbxb-btn--ghost{
  background: #fff;
  border-color: var(--cbx-border);
  color: var(--cbx-text);
}

.cbxb-btn--ghost:hover{
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--cbx-text);
}

.cbxb-btn--soft{
  background: var(--cbx-soft);
  border-color: var(--cbx-soft-2);
  color: var(--cbx-primary);
}

.cbxb-btn--soft:hover{
  background: #e0eeff;
  border-color: #bfdbfe;
  color: var(--cbx-primary-2);
}

/* Chips */
.cbxb-chips{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 14px;
}

.cbxb-chip{
  display:flex;
  align-items:baseline;
  gap: 8px;
  background: var(--cbx-card);
  border: 1px solid var(--cbx-border);
  border-radius: 999px;
  padding: 8px 12px;
}

.cbxb-chip__label{
  font-size: 12px;
  font-weight: 700;
  color: var(--cbx-muted);
}

.cbxb-chip__value{
  font-size: 13px;
  font-weight: 800;
}

/* Tabs */
.cbxb-tabs{
  display:flex;
  gap: 8px;
  margin: 8px 0 14px;
}

.cbxb-tabbtn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  border: 1px solid var(--cbx-border);
  background: #fff;
  color: var(--cbx-text);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.cbxb-tabbtn .dashicons{ font-size: 18px; width: 18px; height: 18px; line-height: 18px; color: var(--cbx-muted); }

.cbxb-tabbtn.is-active{
  background: var(--cbx-soft);
  border-color: #bfdbfe;
  color: var(--cbx-primary);
}

.cbxb-tabbtn.is-active .dashicons{ color: var(--cbx-primary); }

.cbxb-body{ }

/* Grid / cards */
.cbxb-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cbxb-grid--scan{
  grid-template-columns: 1.2fr 1fr 1fr;
}

@media (max-width: 1180px){
  .cbxb-grid--scan{ grid-template-columns: 1fr; }
  .cbxb-orderbox{ min-width: 0; width: 100%; }
  .cbxb-topbar{ flex-direction: column; align-items: stretch; }
}

.cbxb-card{
  background: var(--cbx-card);
  border: 1px solid var(--cbx-border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 10px 26px rgba(15,23,42,.06);
}

.cbxb-card--full{ grid-column: 1 / -1; }

.cbxb-card__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.cbxb-card__title{
  font-size: 14px;
  font-weight: 900;
  margin: 0;
}

.cbxb-card__sub{
  font-size: 12px;
  color: var(--cbx-muted);
  margin-top: 4px;
}

.cbxb-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
  color: #334155;
}

.cbxb-badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 12px;
  border: 1px solid transparent;
}

.cbxb-badge--warn{
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.cbxb-badge--ok{
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.cbxb-formgrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cbxb-field__label{
  font-size: 12px;
  font-weight: 800;
  color: var(--cbx-muted);
  margin-bottom: 6px;
}

.cbxb-actions{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.cbxb-hint{
  margin-top: 10px;
  font-size: 12px;
  color: var(--cbx-muted);
}

.cbxb-hint code{ font-size: 12px; }

/* Table */
.cbxb-tablewrap{ overflow:auto; border-radius: 12px; border: 1px solid var(--cbx-border); }
.cbxb-table{
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.cbxb-table thead th{
  position: sticky;
  top: 0;
  background: #f8fafc;
  border-bottom: 1px solid var(--cbx-border);
  font-size: 12px;
  color: var(--cbx-muted);
  text-align: left;
  padding: 10px 12px;
  font-weight: 900;
}

.cbxb-table td{
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 12px;
  vertical-align: top;
  font-size: 13px;
}

.cbxb-table tr:hover td{ background: #f8fafc; }

.cbxb-table td.num{ width: 60px; }
.cbxb-table td.center{ text-align:center; }

.cbxb-td-flex{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 8px;
}

.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.small{ font-size: 12px; }
.muted{ color: var(--cbx-muted); }

/* Tags / icon buttons */
.cbxb-tag{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--cbx-border);
  background: #fff;
  font-weight: 900;
  font-size: 12px;
}

.cbxb-iconbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--cbx-border);
  background: #fff;
  cursor:pointer;
}

.cbxb-iconbtn:hover{ background:#f8fafc; border-color:#cbd5e1; }
.cbxb-iconbtn .dashicons{ font-size: 16px; width: 16px; height: 16px; line-height: 16px; color: var(--cbx-muted); }

/* Scan */
.cbxb-scanbar{
  display:flex;
  gap: 10px;
  align-items:center;
}

.cbxb-progress{
  height: 10px;
  background: #eef2ff;
  border-radius: 999px;
  overflow:hidden;
  border: 1px solid #e0e7ff;
  margin-top: 10px;
}

.cbxb-progress__bar{
  height: 100%;
  background: var(--cbx-primary);
  width: 0%;
  transition: width .15s ease;
}

.cbxb-list{
  display:flex;
  flex-direction:column;
  gap: 10px;
  max-height: 60vh;
  overflow:auto;
  padding-right: 4px;
}

.cbxb-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  border: 1px solid var(--cbx-border);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
}

.cbxb-item.is-scanned{
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.cbxb-item__code{ font-weight: 900; }
.cbxb-item__meta{
  display:flex;
  flex-wrap: wrap;
  align-items:center;
  gap: 8px;
  margin-top: 6px;
}

.dot{
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
  display:inline-block;
}

/* Empty */
.cbxb-empty{
  padding: 22px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: #fff;
  color: var(--cbx-muted);
  text-align: center;
}

.cbxb-empty.small{ padding: 14px; font-size: 12px; }

/* Toast */
.cbxb-toast{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
  background: #111827;
  color: #fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .15s ease, transform .15s ease;
  box-shadow: var(--cbx-shadow);
  max-width: 360px;
}

.cbxb-toast.show{ opacity: 1; transform: translateY(0); }

.cbxb-toast.is-ok{ background: #166534; }
.cbxb-toast.is-err{ background: #991b1b; }
.cbxb-toast.is-info{ background: #111827; }

/* Modal */
.cbxb-modal{
  position: fixed;
  inset: 0;
  z-index: 100000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px;
}

.cbxb-modal.is-hidden{ display:none; }

.cbxb-modal__backdrop{
  position:absolute;
  inset: 0;
  background: rgba(2,6,23,.55);
  backdrop-filter: blur(4px);
}

.cbxb-modal__panel{
  position: relative;
  width: min(1200px, 96vw);
  height: min(92vh, 860px);
  background: var(--cbx-bg);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--cbx-shadow);
  border: 1px solid rgba(255,255,255,.18);
}

#cbxb-modal-app{ height: 100%; overflow:auto; }

/* Inline buttons in Woo screens */
.cbxb-order-tools{
  display:flex;
  gap: 8px;
  margin-top: 10px;
}

.cbxb-mini-btn{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  color: #0f172a;
  text-decoration:none;
}

.cbxb-mini-btn .dashicons{ font-size: 16px; width: 16px; height: 16px; line-height: 16px; color: #64748b; }
.cbxb-mini-btn:hover{ background:#f8fafc; border-color:#94a3b8; color:#0f172a; }

.cbxb-mini-btn--ghost{
  background: transparent;
}

.cbxb-mini-btn--ghost:hover{
  background:#fff;
}

/* Woo order list action icon */
.wc-action-button-cbxb-open::after{
  font-family: dashicons;
  content: "\f174"; /* dashicons-tag */
}

a.wc-action-button-cbxb-open{
  color: #2563eb !important;
}

a.wc-action-button-cbxb-open:hover{
  color: #1d4ed8 !important;
}
