/* ═══════════════════════════════════════════
   HOME — WIDGET CANVAS
   Loaded only when the Home page is active.
   Relies on tokens.css + chrome.css being loaded first.
═══════════════════════════════════════════ */
.widget-canvas {
  position: relative; flex: 1; overflow: auto;
  background: var(--bg-canvas);
  padding: 14px; min-height: 900px; min-width: 1400px;
}

/* ── Widget shell ── */
.widget {
  position: absolute; background: #fff;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.10);
  overflow: hidden; display: none;
}
.widget.visible { display: block; }
.widget-header {
  background: var(--black); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; cursor: move; user-select: none; height: 32px;
  border-bottom: 2px solid var(--green);
}
.widget-title { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.widget-title i { font-size: 14px; color: #9ab85a; }
.widget-hdr-actions { display: flex; gap: 2px; align-items: center; }
.wha-btn {
  color: rgba(255,255,255,.7); width: 24px; height: 24px;
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer; transition: background .12s, color .12s;
  position: relative;
}
.wha-btn:hover { background: var(--dark-hover); color: #fff; }

/* Widget three-dot dropdown */
.widget-menu {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: #fff; border: 1px solid #bbb;
  box-shadow: 0 4px 14px rgba(0,0,0,.22);
  border-radius: 5px; min-width: 130px; z-index: 999;
  display: none;
}
.widget-menu.open { display: block; }
.widget-menu-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; font-size: 12px; color: #333;
  cursor: pointer; border-bottom: 1px solid #f0f0f0;
  transition: background .12s; white-space: nowrap;
}
.widget-menu-item:last-child { border-bottom: none; }
.widget-menu-item:hover { background: var(--green-lt); color: var(--green); }
.widget-menu-item i { font-size: 13px; color: #666; width: 15px; text-align: center; }
.widget-menu-item:hover i { color: var(--green); }
.widget-menu-item.danger { color: #c0392b; }
.widget-menu-item.danger:hover { background: rgba(192,57,43,.07); }
.widget-menu-item.danger i { color: #c0392b; }

.widget-body { background: var(--widget-bg); }

/* ── Empty state inside widget body ── */
.widget-empty {
  padding: 24px 16px; text-align: center; color: #999; font-size: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.widget-empty i { font-size: 28px; opacity: .4; }

/* ── External link widget shell (Rack Builder / Barcode Generator) ── */
.external-link-body {
  padding: 18px 14px; display: flex; flex-direction: column;
  align-items: center; text-align: center; gap: 8px;
}
.ext-link-icon { font-size: 30px; color: var(--green); opacity: .85; }
.ext-link-desc { font-size: 12px; color: #666; line-height: 1.5; }
.ext-link-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 6px; padding: 7px 0; border-radius: 4px;
  background: var(--green); color: #fff; font-size: 12px; font-weight: 500;
}
.ext-link-btn:hover { background: var(--green-dk); }

/* ── Quick Lookup widget (pulls from master data feed) ── */
.lookup-body { padding: 10px; }
.lookup-search-row { display: flex; gap: 6px; margin-bottom: 10px; }
.lookup-search-row input {
  flex: 1; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 4px; font-size: 13px; font-family: 'Roboto', sans-serif;
  outline: none;
}
.lookup-search-row input:focus { border-color: var(--green); }
.lookup-search-btn {
  background: var(--green); color: #fff; padding: 7px 12px;
  border-radius: 4px; font-size: 13px; display: flex; align-items: center; gap: 5px;
}
.lookup-search-btn:hover { background: var(--green-dk); }
.lookup-results {
  border: 1px solid #e0e0e0; border-radius: 4px;
  min-height: 100px; background: #fafafa; padding: 8px;
  font-size: 12px; color: #888;
}
.lookup-result-item {
  padding: 6px 8px; border-bottom: 1px solid #eee;
  font-size: 13px; color: #333; display: flex; align-items: center; gap: 8px;
}
.lookup-result-item:last-child { border-bottom: none; }
.lookup-placeholder { text-align: center; padding: 18px; color: #aaa; }
.lookup-placeholder i { font-size: 26px; display: block; margin-bottom: 6px; }

/* ── Less Case Pending Sales widget — quick stat shell ── */
.lc-stat-body { padding: 12px 10px; }
.lc-stat-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px; border-bottom: 1px solid #e6e6e6; font-size: 12px; }
.lc-stat-row:last-child { border-bottom: none; }
.lc-stat-lbl { color: #666; }
.lc-stat-val { font-weight: 700; color: #222; }
.lc-stat-val.neg { color: #c0392b; }
.lc-go-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 10px; padding: 7px 0; border-radius: 4px;
  background: var(--green); color: #fff; font-size: 12px; font-weight: 500;
}
.lc-go-btn:hover { background: var(--green-dk); }

/* ── Add Widget Menu overlay ── */
.add-menu-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.35); z-index: 5000;
}
.add-menu-overlay.open { display: block; }
